Skip to content

Commit

Permalink
main: send MsgSendHeaders to peer on VerAck
Browse files Browse the repository at this point in the history
On VerAck, we send MsgSendHeaders to notify the peer that we prefer
headers instead of invs for blocks.
  • Loading branch information
kcalvinalvin committed Jan 17, 2025
1 parent af85977 commit bfd6e09
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,10 @@ func (sp *serverPeer) OnVersion(_ *peer.Peer, msg *wire.MsgVersion) *wire.MsgRej
// to kick start communication with them.
func (sp *serverPeer) OnVerAck(_ *peer.Peer, _ *wire.MsgVerAck) {
sp.server.AddPeer(sp)

// Let the peer know that we prefer headers over invs for block annoucements.
sendHeadersMsg := wire.NewMsgSendHeaders()
sp.QueueMessage(sendHeadersMsg, nil)
}

// OnMemPool is invoked when a peer receives a mempool bitcoin message.
Expand Down

0 comments on commit bfd6e09

Please sign in to comment.