Skip to content

Commit

Permalink
Add hint message for P2P reject reason block not found. (kaspanet#512)
Browse files Browse the repository at this point in the history
  • Loading branch information
1bananagirl authored Aug 7, 2024
1 parent 9feb5dc commit 5ebd9fe
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions protocol/p2p/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ impl ProtocolError {
pub fn from_reject_message(reason: String) -> Self {
if reason == LOOPBACK_CONNECTION_MESSAGE || reason == DUPLICATE_CONNECTION_MESSAGE {
ProtocolError::IgnorableReject(reason)
} else if reason.contains("cannot find full block") {
let hint = "Hint: If this error persists, it might be due to the other peer having pruned block data after syncing headers and UTXOs. In such a case, you may need to reset the database.";
let detailed_reason = format!("{}. {}", reason, hint);
ProtocolError::Rejected(detailed_reason)
} else {
ProtocolError::Rejected(reason)
}
Expand Down

0 comments on commit 5ebd9fe

Please sign in to comment.