Use negative fees with listtransaction result types.

This matches Bitcoin Core Wallet.

Fixes #272.
This commit is contained in:
Josh Rickmar 2015-05-13 13:18:06 -04:00
parent 41b7d4c5ee
commit 736a46ff81

View file

@ -870,7 +870,10 @@ func ListTransactions(details *wtxmgr.TxDetails, syncHeight int32, net *chaincfg
for _, output := range details.MsgTx.TxOut {
outputTotal += btcutil.Amount(output.Value)
}
feeF64 = (debitTotal - outputTotal).ToBTC()
// Note: The actual fee is debitTotal - outputTotal. However,
// this RPC reports negative numbers for fees, so the inverse
// is calculated.
feeF64 = (outputTotal - debitTotal).ToBTC()
}
outputs: