Skip to content

Commit

Permalink
Make sure we block repeated invalid auth attempts early
Browse files Browse the repository at this point in the history
  • Loading branch information
ianopolous committed Oct 24, 2023
1 parent 13fd74b commit 8e96b22
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/org/peergos/protocol/bitswap/BitswapEngine.java
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ public void receiveMessage(MessageOuterClass.Message msg, Stream source) {
.build();
presences.add(presence);
messageSize += presence.getSerializedSize();
} else if (block.isPresent()) {
deniedWants.put(w, true);
LOG.info("Rejecting repeated invalid auth for block " + c + " from " + sourcePeerId.bareMultihash());
}
} else {
boolean hasBlock = store.has(c).join();
Expand Down

0 comments on commit 8e96b22

Please sign in to comment.