Fix reported spendable balances from coinbase outputs. (#467)
Previously, this would not increment the spendable balance for matured coinbase outputs and would only increment the immature balance if the output was still immature.
This commit is contained in:
parent
426c2e9f64
commit
3e598f0f7b
1 changed files with 3 additions and 5 deletions
|
@ -700,11 +700,9 @@ func (w *Wallet) CalculateAccountBalances(account uint32, confirms int32) (Balan
|
|||
}
|
||||
|
||||
bals.Total += output.Amount
|
||||
if output.FromCoinBase {
|
||||
target := int32(w.chainParams.CoinbaseMaturity)
|
||||
if !confirmed(target, output.Height, syncBlock.Height) {
|
||||
bals.ImmatureReward += output.Amount
|
||||
}
|
||||
if output.FromCoinBase && !confirmed(int32(w.chainParams.CoinbaseMaturity),
|
||||
output.Height, syncBlock.Height) {
|
||||
bals.ImmatureReward += output.Amount
|
||||
} else if confirmed(confirms, output.Height, syncBlock.Height) {
|
||||
bals.Spendable += output.Amount
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue