-
Notifications
You must be signed in to change notification settings - Fork 38.7k
wallet: Remove first parameter to ScanForWalletTransactions start_hash #19216
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: Remove first parameter to ScanForWalletTransactions start_hash #19216
Conversation
|
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. |
src/wallet/rpcwallet.cpp
Outdated
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.
Is there a reason you didn't remove the start_block variable?
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.
i didn't want to change the function called but i guess i should
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.
I think this can be removed now that block hash is gone.
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.
indeed
promag
left a 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.
Concept ACK dropping one of the start args. I have a preference to keep start_block hash instead.
5586ef7 to
8d8e4d3
Compare
|
@promag im using the block height because everything that calls it is using the block height |
promag
left a 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 8d8e4d36c3d3cbe8b495869865aa0b8ff83fdbca.
@pstratem the interface uses heights but internally block hash is unambiguous - a block at a certain height can change after a reorg - but not a strong opinion.
src/wallet/rpcwallet.cpp
Outdated
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.
I think this can be removed now that block hash is gone.
Every caller looks up the block hash from a block height immediately before calling.
8d8e4d3 to
dbd8498
Compare
|
@promag the rescan is pretty ambiguous to start with, it's scanning whatever the current active chain is edit: the entire concept in theory should do nothing so it's a much "fuzzier" thing than other wallet ops that handle reorgs cleanly |
|
Code review ACK dbd8498, dropped unnecessary statement since last review |
|
🐙 This pull request conflicts with the target branch and needs rebase. |
|
This isn't a good change, I think. It doesn't simplify the code very much, and makes the scanning code less correct and more fragile. The problem is the new
Calling In general, the only correct way for wallet code to reference blocks is by hash and not by height, and this PR moves in the less correct direction. Also, while |
I've mentioned this before, but considering @ryanofsky comment #19216 (comment) and @ariard work I agree that this is not worth it. |
|
Another option could be to drop the start_height argument and keep the start_block argument |
|
Closing for now. |
Every caller looks up the block hash from a block height immediately before
calling.