Merge pull request #263 from meshplus/fix/fix-for-bug

fix(executor): fix l2root pointer acquisition in for cycle
This commit is contained in:
Aiden X 2020-11-25 19:09:43 +08:00 committed by GitHub
commit 03fed65ff5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -160,7 +160,8 @@ func (exec *BlockExecutor) buildTxMerkleTree(txs []*pb.Transaction) (*types.Hash
contents := make([]merkletree.Content, 0, groupCnt) contents := make([]merkletree.Content, 0, groupCnt)
for _, l2Root := range l2Roots { for _, l2Root := range l2Roots {
contents = append(contents, &l2Root) r := l2Root
contents = append(contents, &r)
} }
root, err := calcMerkleRoot(contents) root, err := calcMerkleRoot(contents)
if err != nil { if err != nil {