mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-01-22 19:43:46 +00:00
consensus: don't duplicate RebuildMerkleRoot in newBlockFromContext
This commit is contained in:
parent
d22286cbbc
commit
b6eef9d275
1 changed files with 1 additions and 7 deletions
|
@ -8,7 +8,6 @@ import (
|
|||
"github.com/nspcc-dev/dbft"
|
||||
"github.com/nspcc-dev/dbft/block"
|
||||
"github.com/nspcc-dev/dbft/crypto"
|
||||
"github.com/nspcc-dev/dbft/merkle"
|
||||
"github.com/nspcc-dev/dbft/payload"
|
||||
coreb "github.com/nspcc-dev/neo-go/pkg/core/block"
|
||||
"github.com/nspcc-dev/neo-go/pkg/core/blockchainer"
|
||||
|
@ -475,12 +474,7 @@ func newBlockFromContext(ctx *dbft.Context) block.Block {
|
|||
|
||||
primaryIndex := uint32(ctx.PrimaryIndex)
|
||||
block.Block.ConsensusData.PrimaryIndex = primaryIndex
|
||||
consensusData := coreb.ConsensusData{
|
||||
PrimaryIndex: primaryIndex,
|
||||
Nonce: ctx.Nonce,
|
||||
}
|
||||
|
||||
mt := merkle.NewMerkleTree(append([]util.Uint256{consensusData.Hash()}, ctx.TransactionHashes...)...)
|
||||
block.Block.MerkleRoot = mt.Root().Hash
|
||||
block.Block.RebuildMerkleRoot()
|
||||
return block
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue