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.