Skip to content

getbalance comment incorrect #8183

@instagibbs

Description

@instagibbs

https://github.com/bitcoin/bitcoin/blob/master/src/wallet/rpcwallet.cpp#L693

// getbalance and "getbalance * 1 true" should return the same number

This appears to not true at least in two cases, at least in regtest:

  • You send funds to yourself
  • You send funds to anyone with -spendzeroconfchange=0

For for first case, getbalance includes the zero conf change.

In the latter case, it seems to differ by the fee amount and coinbase subsidy. Perhaps due to how it accounts coinbase values?

I unfortunately don't understand the 2nd case well enough to make a proper edit to the comment. Is this known behavior?

May be best to simply remove the line.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions