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 {
p.knownBlocks.Add(block.Hash())
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})
} else {
return p2p.Send(p.rw, NewBlockMsg, []interface{}{block, td})

View file

@ -179,7 +179,7 @@ func (t *testService) RunDum(p *p2p.Peer, rw p2p.MsgReadWriter) error {
// close the dumReady channel so that other protocols can run
close(peer.dumReady)
// block until the peer is dropped
for {
_, err := rw.ReadMsg()