-
Notifications
You must be signed in to change notification settings - Fork 38.7k
[Wallet] improve detection of conflicted transactions #7067
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Wallet] improve detection of conflicted transactions #7067
Conversation
|
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.
|
Added two commits:
All tests are passing. |
|
utACK |
88c1ed7 to
dbaffe8
Compare
|
@gmaxwell: Thanks for testing! |
|
Reviewing, haven't tested. Will test when robo tests pass! :) |
|
binaries if some likes to test without self-compiling: https://bitcoin.jonasschnelli.ch/pulls/7067/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The conflicted check can move up here (no need to compute depth in that case).
|
See alternative (but more invasive change) in #7105. |
|
Closing in favor of #7105 |
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: