Skip to content

Commit

Permalink
doc(network): clarify how we handle peers that don't send notfound
Browse files Browse the repository at this point in the history
  • Loading branch information
teor2345 committed Feb 14, 2022
1 parent c8b153f commit 2237ee7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions zebra-network/src/peer/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,14 @@ impl Handler {
// when the response for the second request arrives.
//
// Ignoring the message gives us a chance to synchronize back to the correct
// request.
// request. If that doesn't happen, this request times out.
//
// Peers can avoid these cascading errors by sending an explicit `notfound`.
// Zebra sends `notfound`, but `zcashd` doesn't.
// In case 2, if peers respond with a `notfound` message,
// the cascading errors don't happen. The `notfound` message cancels our request,
// and we know we are in sync with the peer.
//
// Zebra sends `notfound` in response to block requests, but `zcashd` doesn't.
// So we need this message workaround, and the related inventory workarounds.
ignored_msg = Some(Message::Block(block));
}

Expand Down

0 comments on commit 2237ee7

Please sign in to comment.