diff --git a/pkg/core/block_base.go b/pkg/core/block_base.go index 77ec7d61d..d67970009 100644 --- a/pkg/core/block_base.go +++ b/pkg/core/block_base.go @@ -107,8 +107,8 @@ func (b *BlockBase) GetHashableData() []byte { // the modification of transaction will influence the hash value of the block. func (b *BlockBase) createHash() { bb := b.GetHashableData() - b.hash = hash.DoubleSha256(bb) b.verificationHash = hash.Sha256(bb) + b.hash = hash.Sha256(b.verificationHash.BytesBE()) } // encodeHashableFields will only encode the fields used for hashing. diff --git a/pkg/core/transaction/transaction.go b/pkg/core/transaction/transaction.go index 305a577d2..2669c5e8a 100644 --- a/pkg/core/transaction/transaction.go +++ b/pkg/core/transaction/transaction.go @@ -178,8 +178,8 @@ func (t *Transaction) createHash() error { } b := buf.Bytes() - t.hash = hash.DoubleSha256(b) t.verificationHash = hash.Sha256(b) + t.hash = hash.Sha256(t.verificationHash.BytesBE()) return nil }