-
Notifications
You must be signed in to change notification settings - Fork 37.7k
wallet: GetEffectiveBalance #26365
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: GetEffectiveBalance #26365
Conversation
af28073
to
3778f9d
Compare
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. |
return RPCHelpMan{"geteffectivebalance", | ||
"\nReturns the total effective balance.\n" | ||
"The effective balance is what the wallet considers currently spendable at a\n" | ||
"confirmation target of 3 blocks at current feerate.\n", |
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.
Why? This seems quite arbitrary.
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.
Correct, it's totally arbitrary for now but I think making it configurable woudl make it more interesting/useful.
The idea (from #15767 ) is that Bitcoin-qt (primarily) could display some estimate of the actual value that can be sent, after fees. In this case, we could either present the GUI with this "estimate" (3 confirmations seems estimate-ish to me), or there could perhaps be an option/drop-down for user to select which fee style they would like the estimate to use.
For an RPC, user could specify the fees they wanted used.
Anyway, for now I am just working out whether it makes much sense at all, and the best way to architect it (e.g. I started with it in spend.cpp as this made logical sense, but ended up introducing circular dependencies so moved into receive.cpp ...)
3778f9d
to
d651742
Compare
Concept ACK I think it's useful to be able to tell users how much they could actually spend. A three-block target or six-block target seems like a reasonable default, but I'd expect this RPC call to be more useful if it could also take a custom feerate. |
Concept ACK I agree that there should be a configurable fee rate and/or configurable block target. |
🐙 This pull request conflicts with the target branch and needs rebase. |
Going to close this as there are other, cleaner and better-maintained version(s) of it being worked on now. |
This is a rough draft of what a
GetEffectiveBalance
function on the wallet might look like, along with RPC call and wallet interface.Related to #15767
Still todo and open questions:
Required adding a lot of headers toreceive.cpp
which seems sub-optimal. Perhaps the function belongs somewhere else...Doesn't respectavoid_reuse
watch_only