OSDN Git Service

simplify code
authorshenao78 <shenao.78@163.com>
Wed, 1 Sep 2021 07:27:54 +0000 (15:27 +0800)
committershenao78 <shenao.78@163.com>
Wed, 1 Sep 2021 07:27:54 +0000 (15:27 +0800)
contract/tracer.go

index ccb5917..0e3b230 100644 (file)
@@ -62,10 +62,7 @@ func (t *Tracer) DetachBlock(block *types.Block) error {
        var instances []*Instance
        for _, tx := range block.Transactions {
                inUTXOs, outUTXOs := t.parseTransfer(tx)
-               utxos := outUTXOs
-               if len(outUTXOs) == 0 {
-                       utxos = inUTXOs
-               }
+               utxos := append(outUTXOs, inUTXOs...)
                if len(utxos) == 0 {
                        continue
                }