From 276126acde9dfb24d36a5ef1e70ac489df57eac5 Mon Sep 17 00:00:00 2001 From: Paladz Date: Thu, 8 Feb 2018 18:30:24 +0800 Subject: [PATCH] add comment (#374) --- protocol/mempool.go | 1 + protocol/state/utxo_view.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/protocol/mempool.go b/protocol/mempool.go index 0d9a7b6e..25a7e7a6 100644 --- a/protocol/mempool.go +++ b/protocol/mempool.go @@ -85,6 +85,7 @@ func (mp *TxPool) AddTransaction(tx *legacy.Tx, gasOnlyTx bool, height, fee uint for _, id := range tx.TxHeader.ResultIds { output, err := tx.Output(*id) if err != nil { + // error due to it's a retirement, utxo doesn't care this output type so skip it continue } if !gasOnlyTx || *output.Source.Value.AssetId == *consensus.BTMAssetID { diff --git a/protocol/state/utxo_view.go b/protocol/state/utxo_view.go index b22c47bc..b1675cc7 100644 --- a/protocol/state/utxo_view.go +++ b/protocol/state/utxo_view.go @@ -51,6 +51,7 @@ func (view *UtxoViewpoint) ApplyTransaction(block *bc.Block, tx *bc.Tx, statusFa for _, id := range tx.TxHeader.ResultIds { output, err := tx.Output(*id) if err != nil { + // error due to it's a retirement, utxo doesn't care this output type so skip it continue } if statusFail && *output.Source.Value.AssetId != *consensus.BTMAssetID { @@ -103,6 +104,7 @@ func (view *UtxoViewpoint) DetachTransaction(tx *bc.Tx, statusFail bool) error { for _, id := range tx.TxHeader.ResultIds { output, err := tx.Output(*id) if err != nil { + // error due to it's a retirement, utxo doesn't care this output type so skip it continue } if statusFail && *output.Source.Value.AssetId != *consensus.BTMAssetID { -- 2.11.0