validation: Pass tx pool reference into CheckSequenceLocks#13783
validation: Pass tx pool reference into CheckSequenceLocks#13783maflcko merged 1 commit intobitcoin:masterfrom
Conversation
|
This is required for and split off of #13804 |
Reviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
|
Tested ACK fad3b321. |
fad3b32 to
fa7f3fc
Compare
fa7f3fc to
fa7edd4
Compare
fd69e5b to
fa287b8
Compare
fa287b8 to
fa511e8
Compare
|
@ryanofsky It seems the commit you reviewed is unrelated to this pull request? |
utACK fa511e8, pasted the wrong hash previously |
| bool CheckSequenceLocks(const CTransaction &tx, int flags, LockPoints* lp, bool useExistingLockPoints) | ||
| bool CheckSequenceLocks(const CTxMemPool& pool, const CTransaction& tx, int flags, LockPoints* lp, bool useExistingLockPoints) | ||
| { | ||
| AssertLockHeld(cs_main); |
There was a problem hiding this comment.
Unrelated to this PR, but couldn't this AssertLockHeld be removed?
There was a problem hiding this comment.
Good point, but I think we want to keep these for now, since not all compilers support these compile-time annotations and sometimes they have to be disabled due to shortcomings.
There was a problem hiding this comment.
On the other hand, the annotation is incomplete, missing pool.cs?
There was a problem hiding this comment.
True, but should be done in a separate pull, since the changes required are non-trivial (more than one line)
There was a problem hiding this comment.
In order to add that annotation txmempool.h must be included in validation.h and I'm not sure if that is correct because of the circular dependency "txmempool -> validation -> txmempool". I don't know what is the plan here but I think mempool should not depend on validation or am I wrong?
fa511e8 Pass tx pool reference into CheckSequenceLocks (MarcoFalke) Pull request description: `CheckSequenceLocks` is called from ATMP and the member function `CTxMemPool::removeForReorg` without passing in the tx pool object that is used in those function's scope and instead using the global `::mempool` instance. This fix should be refactoring only, since currently there is only one (global) tx pool in normal operation. Though, it fixes hard to track down issues in future settings where more than one mempool exists at a time. (E.g. for tests, rpc or p2p tx relay purposes) Tree-SHA512: f0804588c7d29bb6ff05ec14f22a16422b89ab31ae714f38cd07f811d7dc7907bfd14e799c4c1c3121144ff22711019bbe9212b39e2fd4531936a4119950fa49
Summary: `CheckSequenceLocks` is called from ATMP and the member function `CTxMemPool::removeForReorg` without passing in the tx pool object that is used in those function's scope and instead using the global `::mempool` instance. Backport of Bitcoin Core PR13783 bitcoin/bitcoin#13783 Test Plan: ``` make check-all ``` Reviewers: Fabien, #bitcoin_abc, deadalnix Reviewed By: #bitcoin_abc, deadalnix Differential Revision: https://reviews.bitcoinabc.org/D4178
Summary: `CheckSequenceLocks` is called from ATMP and the member function `CTxMemPool::removeForReorg` without passing in the tx pool object that is used in those function's scope and instead using the global `::mempool` instance. Backport of Bitcoin Core PR13783 bitcoin/bitcoin#13783 Test Plan: ``` make check-all ``` Reviewers: Fabien, #bitcoin_abc, deadalnix Reviewed By: #bitcoin_abc, deadalnix Differential Revision: https://reviews.bitcoinabc.org/D4178
Summary: `CheckSequenceLocks` is called from ATMP and the member function `CTxMemPool::removeForReorg` without passing in the tx pool object that is used in those function's scope and instead using the global `::mempool` instance. Backport of Bitcoin Core PR13783 bitcoin/bitcoin#13783 Test Plan: ``` make check-all ``` Reviewers: Fabien, #bitcoin_abc, deadalnix Reviewed By: #bitcoin_abc, deadalnix Differential Revision: https://reviews.bitcoinabc.org/D4178
…uenceLocks fa511e8 Pass tx pool reference into CheckSequenceLocks (MarcoFalke) Pull request description: `CheckSequenceLocks` is called from ATMP and the member function `CTxMemPool::removeForReorg` without passing in the tx pool object that is used in those function's scope and instead using the global `::mempool` instance. This fix should be refactoring only, since currently there is only one (global) tx pool in normal operation. Though, it fixes hard to track down issues in future settings where more than one mempool exists at a time. (E.g. for tests, rpc or p2p tx relay purposes) Tree-SHA512: f0804588c7d29bb6ff05ec14f22a16422b89ab31ae714f38cd07f811d7dc7907bfd14e799c4c1c3121144ff22711019bbe9212b39e2fd4531936a4119950fa49
CheckSequenceLocksis called from ATMP and the member functionCTxMemPool::removeForReorgwithout passing in the tx pool object that is used in those function's scope and instead using the global::mempoolinstance.This fix should be refactoring only, since currently there is only one (global) tx pool in normal operation. Though, it fixes hard to track down issues in future settings where more than one mempool exists at a time. (E.g. for tests, rpc or p2p tx relay purposes)