core: fix NetworkFee calculation

Add doesn't change the variable state. Thanks to GolangCI for catching this.
This commit is contained in:
Roman Khimov 2020-02-27 11:57:31 +03:00
parent 7bea6e043e
commit 00d199ed85

View file

@ -1053,14 +1053,14 @@ func (bc *Blockchain) NetworkFee(t *transaction.Transaction) util.Fixed8 {
} }
for i := range refs { for i := range refs {
if refs[i].Out.AssetID == UtilityTokenID() { if refs[i].Out.AssetID == UtilityTokenID() {
inputAmount.Add(refs[i].Out.Amount) inputAmount = inputAmount.Add(refs[i].Out.Amount)
} }
} }
outputAmount := util.Fixed8FromInt64(0) outputAmount := util.Fixed8FromInt64(0)
for _, txOutput := range t.Outputs { for _, txOutput := range t.Outputs {
if txOutput.AssetID == UtilityTokenID() { if txOutput.AssetID == UtilityTokenID() {
outputAmount.Add(txOutput.Amount) outputAmount = outputAmount.Add(txOutput.Amount)
} }
} }