File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
consensus/propagation/types Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -206,11 +206,11 @@ func (c *CompactBlock) Proofs() ([]merkle.Proof, error) {
206206 return nil , errors .New ("invalid number of partset hashes" )
207207 }
208208
209- c .proofsCache = make ([]merkle.Proof , 0 , len (c .PartsHashes ))
209+ c .proofsCache = make ([]merkle.Proof , len (c .PartsHashes ))
210210
211211 root , proofs := merkle .ProofsFromLeafHashes (c .PartsHashes [:total ])
212212 for i := range proofs {
213- c .proofsCache = append ( c . proofsCache , proofs [i ])
213+ c .proofsCache [ i ] = proofs [i ]
214214 }
215215
216216 if ! bytes .Equal (root , c .Proposal .BlockID .PartSetHeader .Hash ) {
@@ -219,7 +219,7 @@ func (c *CompactBlock) Proofs() ([]merkle.Proof, error) {
219219
220220 parityRoot , eproofs := merkle .ProofsFromLeafHashes (c .PartsHashes [total :])
221221 for i := range eproofs {
222- c .proofsCache = append ( c . proofsCache , eproofs [i ])
222+ c .proofsCache [ int ( total ) + i ] = eproofs [i ]
223223 }
224224
225225 if ! bytes .Equal (c .BpHash , parityRoot ) {
You can’t perform that action at this time.
0 commit comments