import (
"github.com/vapor/consensus"
+ "github.com/vapor/crypto/sha3pool"
"github.com/vapor/protocol/bc"
"github.com/vapor/protocol/vm"
"github.com/vapor/protocol/vm/vmutil"
r := bc.NewRetirement(src, uint64(i))
resultID = addEntry(r)
} else {
-
// non-retirement
prog := &bc.Program{out.VMVersion, out.ControlProgram}
o := bc.NewOutput(src, prog, uint64(i))
resultIDs = append(resultIDs, &resultID)
mux.WitnessDestinations = append(mux.WitnessDestinations, dest)
}
- h := bc.NewTxHeader(tx.Version, tx.SerializedSize, tx.TimeRange, resultIDs)
+ refdatahash := hashData(tx.ReferenceData)
+ h := bc.NewTxHeader(tx.Version, tx.SerializedSize, &refdatahash, tx.TimeRange, resultIDs)
return addEntry(h), h, entryMap
}
}
return b
}
+
+func hashData(data []byte) bc.Hash {
+ var b32 [32]byte
+ sha3pool.Sum256(b32[:], data)
+ return bc.NewHash(b32)
+}