Send Announcement instead of ping in case blockchain info was not refreshed within a certain threshold. This helps to keep the global blockchain cache active, with no additional overhead. Close #78

This commit is contained in:
Kleissner
2021-12-12 01:06:55 +01:00
parent ea31af1f6e
commit 0cd4519688
5 changed files with 56 additions and 18 deletions

View File

@@ -110,7 +110,8 @@ func DecodeResponse(msg *MessageRaw) (result *MessageResponse, err error) {
read += 6
if countPeerResponses == 0 && countEmbeddedFiles == 0 && countHashesNotFound == 0 {
return nil, errors.New("response: empty")
// Empty responses are allowed. They can be useful as quasi-pings to get the latest blockchain info of the peer.
return
}
data := msg.Payload[read:]