upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbitflash-maintainer <noreply@bitflash.invalid>2026-08-12 16:08:22 +0000
committerbitflash-maintainer <noreply@bitflash.invalid>2026-08-19 22:48:27 +0000
commit6401992a1a89dc2e7ec670b6979b0d2095049e49 (patch)
tree54dee31862e647ce63df920ac2ac9b2b8312dd13
parent7f6e5adc6945da36bd135883c5316514599d3a53 (diff)
net: time the stall, not the wait, before dropping an unreadable peer
Found auditing the previous commit for the push. Timing from the first rewind would drop a peer whose message is large and merely slow, which would be a fault of our own making rather than one we fixed. Restart the clock whenever the buffer has grown by even one byte since the last look. A transfer still making progress is never dropped however long it takes; only one that has stopped growing while the node goes on expecting more is, which is the actual failure. (cherry picked from commit 5dddb26bae02013ce87719b11953aadf0bfa2594)
-rw-r--r--src/net.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/net.h b/src/net.h
index 112426e..440550c 100644
--- a/src/net.h
+++ b/src/net.h
@@ -670,9 +670,13 @@ public:
670 string strBtfAddr; 670 string strBtfAddr;
671 string strBtfMeeting; 671 string strBtfMeeting;
672 672
673 // When this peer's message loop first rewound a header to wait for the 673 // When this peer's message loop last rewound a header without having made
674 // rest of a message, or 0 when it is not waiting. See ProcessMessages. 674 // progress, or 0 when it is not waiting, plus how much was buffered then.
675 // The pair times a STALL rather than a duration, so a large message
676 // arriving slowly is never mistaken for one that is never arriving.
677 // See ProcessMessages.
675 int64 nMsgWaitSince; 678 int64 nMsgWaitSince;
679 unsigned int nMsgWaitSize;
676 680
677 // Height this peer announced in its version message, or -1 if it sent a 681 // Height this peer announced in its version message, or -1 if it sent a
678 // version message that predates the field. Knowing how far along everyone 682 // version message that predates the field. Knowing how far along everyone