server: always reply with get headers

backport of https://github.com/decred/dcrd/pull/1295
This commit is contained in:
Conner Fromknecht 2018-07-31 21:15:02 -07:00
parent 9a2f952402
commit 90c2094cbd
No known key found for this signature in database
GPG key ID: E7D737B67FA592C7

View file

@ -742,10 +742,6 @@ func (sp *serverPeer) OnGetHeaders(_ *peer.Peer, msg *wire.MsgGetHeaders) {
// This mirrors the behavior in the reference implementation.
chain := sp.server.chain
headers := chain.LocateHeaders(msg.BlockLocatorHashes, &msg.HashStop)
if len(headers) == 0 {
// Nothing to send.
return
}
// Send found headers to the requesting peer.
blockHeaders := make([]*wire.BlockHeader, len(headers))