From 00d199ed8500097ae5becd8a4f90d87c4651a6ab Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Thu, 27 Feb 2020 11:57:31 +0300 Subject: [PATCH] core: fix NetworkFee calculation Add doesn't change the variable state. Thanks to GolangCI for catching this. --- pkg/core/blockchain.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/core/blockchain.go b/pkg/core/blockchain.go index 106149043..434a3886c 100644 --- a/pkg/core/blockchain.go +++ b/pkg/core/blockchain.go @@ -1053,14 +1053,14 @@ func (bc *Blockchain) NetworkFee(t *transaction.Transaction) util.Fixed8 { } for i := range refs { if refs[i].Out.AssetID == UtilityTokenID() { - inputAmount.Add(refs[i].Out.Amount) + inputAmount = inputAmount.Add(refs[i].Out.Amount) } } outputAmount := util.Fixed8FromInt64(0) for _, txOutput := range t.Outputs { if txOutput.AssetID == UtilityTokenID() { - outputAmount.Add(txOutput.Amount) + outputAmount = outputAmount.Add(txOutput.Amount) } }