-
Notifications
You must be signed in to change notification settings - Fork 37.4k
rpc: Avoid useless mempool query in gettxoutproof #19589
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
Conversation
Based on feedback by @jnewbery in #19556 (comment) |
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.
Code review ACK, refactor looks good with the following exception.
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.
ACK fa6e74b, I have reviewed the code and it looks OK, I agree it can be merged.
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.
Concept ACK.
fa612a7
to
fadd84b
Compare
Addressed all feedback |
utACK fa5979d Nice tidy-up. Thanks Marco! |
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, 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. |
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.
re-ACK fa5979d
Code review ACK fa5979d. |
fa5979d rpc: Avoid useless mempool query in gettxoutproof (MarcoFalke) fa1f7f2 rpc: Style fixups in gettxoutproof (MarcoFalke) Pull request description: `GetTransaction` implicitly and unconditionally asks the mempool global for a transaction. This is problematic for several reasons: * `gettxoutproof` is for on-chain txs only and asking the mempool for on-chain txs is confusing and minimally wasteful * Globals are confusing and make code harder to test with unit tests Fix both issues by passing in an optional mempool. This also helps with bitcoin#19556 ACKs for top commit: hebasto: re-ACK fa5979d jnewbery: utACK fa5979d promag: Code review ACK fa5979d. Tree-SHA512: 048361b82abfcc40481181bd44f70cfc9e97d5d6356549df34bbe30b9de7a0a72d2207a3ad0279b21f06293509b284d8967f58ca7e716263a22b20aa4e7f9c54
Summary: > GetTransaction implicitly and unconditionally asks the mempool global for a transaction. This is problematic for several reasons: > > - gettxoutproof is for on-chain txs only and asking the mempool for on-chain txs is confusing and minimally wasteful > - Globals are confusing and make code harder to test with unit tests > > Fix both issues by passing in an optional mempool. This also helps with [[bitcoin/bitcoin#19556 | core#19556]] This is a backport of [[bitcoin/bitcoin#19589 | core#19589]] Test Plan: `ninja all check-all` Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Subscribers: Fabien Differential Revision: https://reviews.bitcoinabc.org/D9783
GetTransaction
implicitly and unconditionally asks the mempool global for a transaction. This is problematic for several reasons:gettxoutproof
is for on-chain txs only and asking the mempool for on-chain txs is confusing and minimally wastefulFix both issues by passing in an optional mempool. This also helps with #19556