forked from TrueCloudLab/neoneo-go
consensus: don't use WriteArray for PrepareRequests
It's convenient, but it's not efficient due to reflection use.
This commit is contained in:
parent
b0744c2b21
commit
54f75bb999
1 changed files with 4 additions and 1 deletions
|
@ -26,7 +26,10 @@ func (p *prepareRequest) EncodeBinary(w *io.BinWriter) {
|
|||
w.WriteBytes(p.prevHash[:])
|
||||
w.WriteU64LE(p.timestamp)
|
||||
w.WriteU64LE(p.nonce)
|
||||
w.WriteArray(p.transactionHashes)
|
||||
w.WriteVarUint(uint64(len(p.transactionHashes)))
|
||||
for i := range p.transactionHashes {
|
||||
w.WriteBytes(p.transactionHashes[i][:])
|
||||
}
|
||||
if p.stateRootEnabled {
|
||||
w.WriteBytes(p.stateRoot[:])
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue