diff --git a/blockchain/stake/treasury.go b/blockchain/stake/treasury.go index 8bd029445..a1522b90f 100644 --- a/blockchain/stake/treasury.go +++ b/blockchain/stake/treasury.go @@ -72,8 +72,7 @@ func CheckTAdd(tx *wire.MsgTx) error { // All output scripts must be version 0 and non-empty. const consensusScriptVer = 0 - for txOutIdx := range tx.TxOut { - txOut := tx.TxOut[txOutIdx] + for txOutIdx, txOut := range tx.TxOut { if txOut.Version != consensusScriptVer { str := fmt.Sprintf("treasury add transaction output %d script "+ "version is %d instead of %d", txOutIdx, txOut.Version, diff --git a/blockchain/stake/treasury_test.go b/blockchain/stake/treasury_test.go index cb9dda465..7b6f359d2 100644 --- a/blockchain/stake/treasury_test.go +++ b/blockchain/stake/treasury_test.go @@ -80,7 +80,7 @@ func treasurySpendSignature(sig, pubKey []byte) []byte { } // fakeTreasurySpendSignature returns a signature script that is valid enough to -// pass all checks, but would fail if actually checked. This identification +// pass all checks, but would fail if actually checked. The identification // funcs in this package do not verify signatures, so valid signatures are not // required for the tests. func fakeTreasurySpendSignature() []byte { @@ -183,7 +183,7 @@ func TestTreasuryIsFunctions(t *testing.T) { tests := []struct { name string // test description tx *wire.MsgTx // transaction to test - treasuryAdd bool // expected check is treasury add + treasuryAdd bool // expected is treasury add treasuryBase bool // expected is treasury base treasurySpend bool // expected is treasury spend }{{