-
Notifications
You must be signed in to change notification settings - Fork 329
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
misleading spendable balance #797
Comments
Concept ACK for using |
I had a chat with @hrik2001 and he's going to work on this one :) |
We just discussed this issue in bitcoindevkit/.github#35:
For these reasons, it's better if we delay fixing this issue until we have a clear path for #676, and at that point, fix both at the same time in BDK 1.0 |
My vote goes to depreciating |
note this is ready to fix in here's the function: https://github.com/LLFourn/bdk_core_staging/blob/0fb4e1b20c4d31ecb785509311124d3fc4222902/bdk_chain/src/keychain/keychain_tracker.rs#L238 |
I think we should keep a
On
Then, regarding #676: I'm quite torn between having a Either
we could probably omit Let's show with an example how both methods would work. In both cases, we have the policy Let's start with
While
Again, this seems pretty clear to me, but it does have all the drawbacks of the current
This looks fine, but when we introduce timelocks, things start to get weird...
In this case, we don't have the timelock as an asset, so we can spend just utxo3 (the timelock is already satisfied). I don't know about you, but I find this a bit confusing...
This is weird as well: I'm saying that I'll wait Let me know what you think :) |
Topic came up to also the names "trusted_pending" and "untrusted_pending" aren't accurate. @danielabrozzoni may have some suggestions for other naming. My 2 sats is to not make a distinction and only have a "pending" balance 🙂. See comment: https://github.com/bitcoindevkit/bdk/pull/976/files#r1210283701 |
I added this to 1.0.0-alpha.3 since it's a wallet breaking change so would be good to get it cleaned up now. |
This is not urgent and can be done in a future major release so removing from 1.0 milestone. |
Fixed by #640 . |
Describe the bug
I've noticed a strange behaviour of the
get_balance
API.To Reproduce
Creating a new wallet and sending some funds to it produces the following balance:
Since the spendable balance is
0
I assumed it was not possible to send funds, but still I've been able to spend the funds and bdk now reports the following balance:Maybe this is not a bug and is just a matter of naming, but to me
spendable
should reflect the amount of funds that is possible to spend.Expected behavior
I see that you documented
spendable
as the "sum of trusted_pending and confirmed coins", so IMO a more fitting name could besafe_to_spend
balance.Moreover we probably need also a
spendable
balance defined as the sum of funds that can be spent, that I think will be the sum of all balances except theimmature
one.Build environment
v0.24.0
debian 11
1.65.0
x86_64-unknown-linux-gnu
The text was updated successfully, but these errors were encountered: