eth: implement the NewBlockHashes protocol proposal

This commit is contained in:
Péter Szilágyi
2015-06-04 18:46:07 +03:00
parent c6faa18ec9
commit 6f415b96b3
3 changed files with 123 additions and 63 deletions

View File

@@ -88,6 +88,10 @@ func (p *peer) sendBlocks(blocks []*types.Block) error {
return p2p.Send(p.rw, BlocksMsg, blocks)
}
func (p *peer) sendNewBlockHashes(hashes []common.Hash) error {
return p2p.Send(p.rw, NewBlockHashesMsg, hashes)
}
func (p *peer) sendNewBlock(block *types.Block) error {
p.blockHashes.Add(block.Hash())