Skip to content

Commit 94130ac

Browse files
committed
comments about appending outputs to slice of txID
1 parent fe47417 commit 94130ac

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

chain/block.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,9 @@ func (b *StatelessBlock) initializeBuilt(
300300
txID := b.Txs[i].ID()
301301
resultOutput := b.results[i].Output
302302
// [txID + resultOutput]
303+
// txID is a fixed length array, hence [append] will always allocate new memory and copy
304+
// so slice with new address will be returned and no reflect on txID, then later
305+
// we consume those bytes
303306
merkleItems = append(merkleItems, append(txID[:], resultOutput...))
304307
}
305308

0 commit comments

Comments
 (0)