No response to MsgGetBlocks with stopHash zero makes stall detection kick in
If a GetBlocks message is sent to a peer on the same tip as the sending node, with a stop hash zero, then the receiving node will not reply (as it has no inv to send: https://github.com/btcsuite/btcd/blob/2a560b2036bee5e3679ec2133eb6520b2f195213/server.go#L710) and the sending node will disconnect the node assuming it has stalled: https://github.com/btcsuite/btcd/blob/2a560b2/peer/peer.go#L1279
Currently I am experiencing this during tests on regtest, since regtest is special cased to not do headers-first mode, and such a GetBlocks message is sent at initial connect: https://github.com/btcsuite/btcd/blob/2a560b2/netsync/manager.go#L310
Not sure what would be the correct fix here; to remove this special casing of regtest, or to not always expect an INV in return for this getblocks message.
Source: btcsuite/btcd