Skip to content
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: change getwalletinfo RPC 'balance' to be confirmed balance, i… #508

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/wallet/rpc.js
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ class RPC extends RPCBase {
return {
walletid: wallet.id,
walletversion: 6,
balance: Amount.coin(balance.unconfirmed, true),
balance: Amount.coin(balance.confirmed, true),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok my thinking on this: Let's not break backwards compatibility by changing what is returned here. We don't want to mess up any application relying on this value always being the "safest" (confirmed) balance.

What I think could be useful is just adding more values. We already have unconfirmed_balance, let's just add confirmed_balance and spendable_balance (combine with #507)

unconfirmed_balance: Amount.coin(balance.unconfirmed, true),
txcount: balance.tx,
keypoololdest: 0,
Expand Down