OSDN Git Service

add comment (#374)
authorPaladz <yzhu101@uottawa.ca>
Thu, 8 Feb 2018 10:30:24 +0000 (18:30 +0800)
committerGitHub <noreply@github.com>
Thu, 8 Feb 2018 10:30:24 +0000 (18:30 +0800)
protocol/mempool.go
protocol/state/utxo_view.go

index 0d9a7b6..25a7e7a 100644 (file)
@@ -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 {
index b22c47b..b1675cc 100644 (file)
@@ -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 {