Skip to content

Conversation

instagibbs
Copy link
Member

Currently the only message reported during RPC usage and tests is the unhelpful

JSONRPC error: Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of the wallet and coins were spent in the copy but not marked as spent here.

@maflcko maflcko added the Wallet label Oct 25, 2016
@maflcko
Copy link
Member

maflcko commented Oct 25, 2016

Thanks!

utACK 3df625f49911d0af512dc53d3b9b4a71f3dcd754

// Broadcast
if (!wtxNew.AcceptToMemoryPool(maxTxFee)) {
if (!wtxNew.AcceptToMemoryPool(maxTxFee, state)) {
// This must not fail. The transaction has already been signed and recorded.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I think you can just remove this comment, as it is outdated since at least 0.12.0

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you explain how so?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 0.12.0 release notes says "[...] limits [...] the length and size of unconfirmed transaction chains that are allowed in the mempool (generally limiting the length of unconfirmed chains to 25 transactions, with a total size of 101 KB)."

So claiming this "must not fail" is a somewhat strong claim.

Copy link
Member Author

@instagibbs instagibbs Oct 25, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, is "must not" being used in the descriptive sense rather than prescriptive? (I read it as "oh it better not or there is trouble)If so, we should definitely re-write this.

Also, I've encountered that specific error before so I'd agree with you.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC the trouble means that you end up with transactions in your wallet that may never reach the mempool or a block.

But consider my nit a µnit, it can be done in a later pull.

@maflcko maflcko added the Docs label Oct 25, 2016
@instagibbs
Copy link
Member Author

On second thought, I might want to pass the error up through CommitTransaction. Right now it's only logged in debug.log in all the codepaths. Or I could change the error message to direct the user to check the debug log.

@laanwj
Copy link
Member

laanwj commented Oct 26, 2016

Or I could change the error message to direct the user to check the debug log.

Does this require enabling any debug flags?

@laanwj
Copy link
Member

laanwj commented Oct 26, 2016

Concept ACK, though I'd really prefer reporting the specific problem inline instead of directing the user at the debug log.

@instagibbs
Copy link
Member Author

@laanwj Done. This should show up during rpc test failures as well,

@jonasschnelli
Copy link
Contributor

Nice.
utACK 169bdab
Possible GUI extension (in another PR) would be to pass the state.GetRejectReason() down to the error display logic and allow the user to get the rejection details in the dialog. But meh.

@laanwj
Copy link
Member

laanwj commented Oct 28, 2016

utACK 169bdab

@laanwj laanwj merged commit 169bdab into bitcoin:master Oct 28, 2016
laanwj added a commit that referenced this pull request Oct 28, 2016
169bdab Return useful error message on ATMP failure (instagibbs)
@maflcko
Copy link
Member

maflcko commented Oct 28, 2016

post merge re-utACK 169bdab

codablock pushed a commit to codablock/dash that referenced this pull request Jan 13, 2018
169bdab Return useful error message on ATMP failure (instagibbs)
andvgal pushed a commit to energicryptocurrency/gen2-energi that referenced this pull request Jan 6, 2019
169bdab Return useful error message on ATMP failure (instagibbs)
CryptoCentric pushed a commit to absolute-community/absolute that referenced this pull request Feb 15, 2019
169bdab Return useful error message on ATMP failure (instagibbs)
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants