[refactor] Merge getreceivedby tally into GetReceived function#17579
[refactor] Merge getreceivedby tally into GetReceived function#17579maflcko merged 1 commit intobitcoin:masterfrom
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. |
2377697 to
915a40a
Compare
src/wallet/rpcwallet.cpp
Outdated
There was a problem hiding this comment.
This uses the multiple address case, used by getreceivedbylabel, and the singular case used by getreceivedbyaddress is no longer needed.
theStack
left a comment
There was a problem hiding this comment.
Concept ACK, left a view code review comments (mostly nits though)
915a40a to
994ffd6
Compare
|
@theStack thank you for the review. I've addressed all comments. |
dcd65c8 to
4111967
Compare
|
utACK 4111967281a37cfe0d34802a80dba0715bfe3ffb Nice cleanup, and also nice to hoist the DepthInMainChain check out of the inner loop. Optionally, since this is more than a pure code move, some of the variable names/comments could be improved as well (the "addresses" variable name, as well as the comment referring to pubkeys are outdated). |
4111967 to
a1d5b12
Compare
| // Minimum confirmations | ||
| int min_depth = 1; | ||
| if (!params[1].isNull()) | ||
| min_depth = params[1].get_int(); |
There was a problem hiding this comment.
| // Minimum confirmations | |
| int min_depth = 1; | |
| if (!params[1].isNull()) | |
| min_depth = params[1].get_int(); | |
| const int min_depth{params[1].isNull() ? 1 : params[1].get_int()}; |
can be written shorter
…eived function a1d5b12 Merge getreceivedby tally into GetReceived function (Andrew Toth) Pull request description: This PR merges the tally code of `getreceivedbyaddress` and `getreceivedbylabel` into a single function `GetReceived`. This reduces repeated code and makes it similar to `listreceivedbyaddress` and `listreceivedbylabel`, which use the function `ListReceived`. It will also make the change in bitcoin#14707 simpler and easier to review. ACKs for top commit: theStack: re-ACK bitcoin@a1d5b12 meshcollider: utACK a1d5b12 Tree-SHA512: 43d9cd92f7c2c6a8b9c7509aa85a9b9233a6cfec1c43a9062e3bdfb83515413d1feafa8938c828351278ba22bd31c47e62ab5341e4bddc2493103b094d73b047
…d function
Summary:
a1d5b12ec07d2f7aa9fa955a6dd99e8a2be5cb25 Merge getreceivedby tally into GetReceived function (Andrew Toth)
Pull request description:
This PR merges the tally code of `getreceivedbyaddress` and `getreceivedbylabel` into a single function `GetReceived`. This reduces repeated code and makes it similar to `listreceivedbyaddress` and `listreceivedbylabel`, which use the function `ListReceived`. It will also make the change in #14707 simpler and easier to review.
ACKs for top commit:
theStack:
re-ACK bitcoin/bitcoin@a1d5b12
meshcollider:
utACK a1d5b12ec07d2f7aa9fa955a6dd99e8a2be5cb25
---
Backport of Core [[bitcoin/bitcoin#17579 | PR17579]]
Test Plan:
ninja all check check-functional
Reviewers: #bitcoin_abc, jasonbcox
Reviewed By: #bitcoin_abc, jasonbcox
Differential Revision: https://reviews.bitcoinabc.org/D7939
This PR merges the tally code of
getreceivedbyaddressandgetreceivedbylabelinto a single functionGetReceived. This reduces repeated code and makes it similar tolistreceivedbyaddressandlistreceivedbylabel, which use the functionListReceived. It will also make the change in #14707 simpler and easier to review.