mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 04:36:42 +00:00
fix rlp for blocksMsg and getBlocksMsg in eth protocol
This commit is contained in:
parent
eb88474d84
commit
0e5e7eb310
1 changed files with 3 additions and 3 deletions
|
|
@ -186,7 +186,7 @@ func (self *ethProtocol) handle() error {
|
|||
}
|
||||
block := self.chainManager.GetBlock(hash)
|
||||
if block != nil {
|
||||
blocks = append(blocks, block.RlpData())
|
||||
blocks = append(blocks, block)
|
||||
}
|
||||
if i == blockHashesBatchSize {
|
||||
break
|
||||
|
|
@ -198,7 +198,7 @@ func (self *ethProtocol) handle() error {
|
|||
msgStream := rlp.NewStream(msg.Payload)
|
||||
msgStream.List()
|
||||
for {
|
||||
var block [1]*types.Block
|
||||
var block *types.Block
|
||||
if err := msgStream.Decode(&block); err != nil {
|
||||
if err == rlp.EOL {
|
||||
break
|
||||
|
|
@ -206,7 +206,7 @@ func (self *ethProtocol) handle() error {
|
|||
return self.protoError(ErrDecode, "msg %v: %v", msg, err)
|
||||
}
|
||||
}
|
||||
self.blockPool.AddBlock(block[0], self.id)
|
||||
self.blockPool.AddBlock(block, self.id)
|
||||
}
|
||||
|
||||
case NewBlockMsg:
|
||||
|
|
|
|||
Loading…
Reference in a new issue