[Wallet] improve detection of conflicted transactions#7067
Closed
jonasschnelli wants to merge 5 commits intobitcoin:masterfrom
Closed
[Wallet] improve detection of conflicted transactions#7067jonasschnelli wants to merge 5 commits intobitcoin:masterfrom
jonasschnelli wants to merge 5 commits intobitcoin:masterfrom
Conversation
Contributor
Author
|
Also includes a simple mempool limiting RPC test, PR passed this new test (confirmations = 0) as well as the |
<0 (-1) stands for conflicted transactions. Broadcast everything that is not in the chain.
Contributor
Author
|
Added two commits:
All tests are passing. |
Member
|
utACK |
88c1ed7 to
dbaffe8
Compare
Contributor
Author
|
@gmaxwell: Thanks for testing! |
Contributor
|
Reviewing, haven't tested. Will test when robo tests pass! :) |
Contributor
Author
|
binaries if some likes to test without self-compiling: https://bitcoin.jonasschnelli.ch/pulls/7067/ |
Member
There was a problem hiding this comment.
The conflicted check can move up here (no need to compute depth in that case).
Member
|
See alternative (but more invasive change) in #7105. |
Contributor
Author
|
Closing in favor of #7105 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If a wallet transaction gets evicted from the mempool (through maxmempool or similar ways of eviction like a bitcoind restart), the particular transaction was marked as conflicted (confirmations = -1) and the inputs can be spent again.
This PR enabled detection of conflicted transactions by actually checking the mempool and the utxo set. The "conflicted" flag is cached in memory and re-checked during a block tip update.
The check could be further improved: