Keep mempool consistent during block-reorgs#5945
Merged
laanwj merged 1 commit intobitcoin:masterfrom Apr 6, 2015
Merged
Conversation
9861337 to
c22adce
Compare
Contributor
|
I tested this. ACK. |
Contributor
There was a problem hiding this comment.
This could use some comments saying what this block of code is intending to actually do; not obvious right now.
Contributor
Author
There was a problem hiding this comment.
Comment added.
c22adce to
ad9e86d
Compare
This fixes a subtle bug involving block re-orgs and non-standard transactions. Start with a block containing a non-standard transaction, and one or more transactions spending it in the memory pool. Then re-org away from that block to another chain that does not contain the non-standard transaction. Result before this fix: the dependent transactions get stuck in the mempool without their parent, putting the mempool in an inconsistent state. Tested with a new unit test.
Contributor
|
Very much untested and rushed ACK |
Member
|
Going to test this. |
Member
|
Untested ACK. |
Contributor
|
I was observed two crashes in 0.10rc1, each 24 hours apart with checkmempool=1 (and a non-default fee policy) during reorgs that appeared to be likely due to the bug this fixes. I've now run three days with this pull applied and no crashes, and there have been several reorgs during that time. |
Member
|
Tested ACK |
laanwj
added a commit
that referenced
this pull request
Apr 6, 2015
ad9e86d Keep mempool consistent during block-reorgs (Gavin Andresen)
Member
|
Backported to 0.10 branch as 8bb4abc19ae0e76424e69a19ff6fc31e5b044333 |
gavinandresen
added a commit
that referenced
this pull request
Apr 6, 2015
This fixes a subtle bug involving block re-orgs and non-standard transactions. Start with a block containing a non-standard transaction, and one or more transactions spending it in the memory pool. Then re-org away from that block to another chain that does not contain the non-standard transaction. Result before this fix: the dependent transactions get stuck in the mempool without their parent, putting the mempool in an inconsistent state. Tested with a new unit test (adapted for 0.10). Rebased-From: ad9e86d Github-Pull: #5945
reddink
pushed a commit
to reddcoin-project/reddcoin-3.10
that referenced
this pull request
Jul 11, 2020
This fixes a subtle bug involving block re-orgs and non-standard transactions. Start with a block containing a non-standard transaction, and one or more transactions spending it in the memory pool. Then re-org away from that block to another chain that does not contain the non-standard transaction. Result before this fix: the dependent transactions get stuck in the mempool without their parent, putting the mempool in an inconsistent state. Tested with a new unit test (adapted for 0.10). Rebased-From: ad9e86d Github-Pull: bitcoin#5945 (cherry picked from commit 1c62e84)
reddink
pushed a commit
to reddcoin-project/reddcoin-3.10
that referenced
this pull request
Jul 14, 2020
This fixes a subtle bug involving block re-orgs and non-standard transactions. Start with a block containing a non-standard transaction, and one or more transactions spending it in the memory pool. Then re-org away from that block to another chain that does not contain the non-standard transaction. Result before this fix: the dependent transactions get stuck in the mempool without their parent, putting the mempool in an inconsistent state. Tested with a new unit test (adapted for 0.10). Rebased-From: ad9e86d Github-Pull: bitcoin#5945 (cherry picked from commit 1c62e84)
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.
This fixes a subtle bug involving block re-orgs and non-standard transactions.
Start with a block containing a non-standard transaction, and
one or more transactions spending it in the memory pool.
Then re-org away from that block to another chain that does
not contain the non-standard transaction.
Result before this fix: the dependent transactions get stuck
in the mempool without their parent, putting the mempool
in an inconsistent state.
Tested with a new unit test.
Thanks to Alex Morcos for finding the bug.