add a pair connections with each peer

This commit is contained in:
Nguyen Ba Tam 2018-10-01 16:56:26 +07:00 committed by Tuna
parent a9e181e5a6
commit 192a985253
2 changed files with 2 additions and 2 deletions

View file

@ -168,7 +168,7 @@ func (p *peer) SendNewBlockHashes(hashes []common.Hash, numbers []uint64) error
func (p *peer) SendNewBlock(block *types.Block, td *big.Int) error { func (p *peer) SendNewBlock(block *types.Block, td *big.Int) error {
p.knownBlocks.Add(block.Hash()) p.knownBlocks.Add(block.Hash())
if p.pairRw != nil { if p.pairRw != nil {
log.Trace("p2p Send New Block with pairRw", "p", p, "number", block.NumberU64()) log.Trace("p2p send new block to the pairRw connection", "p", p, "number", block.NumberU64())
return p2p.Send(p.pairRw, NewBlockMsg, []interface{}{block, td}) return p2p.Send(p.pairRw, NewBlockMsg, []interface{}{block, td})
} else { } else {
return p2p.Send(p.rw, NewBlockMsg, []interface{}{block, td}) return p2p.Send(p.rw, NewBlockMsg, []interface{}{block, td})