mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
add a pair connections with each peer
This commit is contained in:
parent
a9e181e5a6
commit
192a985253
2 changed files with 2 additions and 2 deletions
|
|
@ -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})
|
||||||
|
|
|
||||||
|
|
@ -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 the dumReady channel so that other protocols can run
|
||||||
close(peer.dumReady)
|
close(peer.dumReady)
|
||||||
|
|
||||||
// block until the peer is dropped
|
// block until the peer is dropped
|
||||||
for {
|
for {
|
||||||
_, err := rw.ReadMsg()
|
_, err := rw.ReadMsg()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue