Skip to content

Report a reason when a duplicate pubcoin keeps a transaction out of the mempool - #1092

Open
whiskyrelaxing wants to merge 1 commit into
Veil-Project:masterfrom
whiskyrelaxing:pubcoin-reject-reason
Open

whiskyrelaxing wants to merge 1 commit into
Veil-Project:masterfrom
whiskyrelaxing:pubcoin-reject-reason

Conversation

@whiskyrelaxing

Copy link
Copy Markdown

The two duplicate pubcoin checks in AcceptToMemoryPoolWorker return false
without setting CValidationState, so the caller learns that the transaction
failed and never why. Every other refusal in the same loop sets one, including
the matching pair for serials, zcspend-already-known and
zcspend-already-in-mempool.

A failed mint on 1.4.5.0 reports this:

ERROR: CommitTransaction(): Transaction cannot be broadcast immediately,  (code 0)
AutoZeromint: auto minting failed with 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 wallet.dat and coins were spent in the
copy but not marked as spent here.

Which is worse than confusing. CommitTransaction calls AddToWallet before it
tests the mempool, so for a mint funded from RingCT the anon wallet has already
marked the input spent. The balance drops, the transaction sits at zero
confirmations, and abandontransaction cannot release it because the flag lives
in AnonWallet mapRecords. Only rescanblockchain clears it.

#626 and #542 are the same wall with a different reason behind it, found both
times by reading debug.log.

state.Invalid forwards to DoS(0, ...), so nothing changes for peers.

@ohcee ohcee left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

utACK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants