[DEV-94] Always reply with get headers

This commit is contained in:
Ori Newman 2018-08-14 15:48:29 +03:00 committed by stasatdaglabs
parent d9abfa0fd3
commit 176aad5dcd

View File

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