upleb.uk

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

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbitflash-maintainer <noreply@bitflash.invalid>2026-09-02 16:44:57 +0000
committerbitflash-maintainer <noreply@bitflash.invalid>2026-09-02 16:44:57 +0000
commitcc21a1db50c14c0c41986e9137432e5ba8918b2d (patch)
tree2a8c1aed3746395c493b91de314b360678abf90b /src
parente3cc976ae3f211727e3fae702776aacca46efb0c (diff)
net: gate the dropped-send line on the category of the send it drops
2661de1 said all the "sending: " emission sites agree on the category. There is a fourth, and it did not: EndMessage()'s -dropmessagestest path hardcoded "net", so under plain -debug a dropped tx announced its own drop while the "sending: tx" it interrupts was gated off under "relay". The knob is test-only, so nothing operational rode on it, but the claim was false as written. Derive it from SendLogCategory() like the other three. nPushPos may be -1 at this point, and GetMessageCommand() returns "" there, so the category is "net" exactly as before when there is no message in progress.
Diffstat (limited to 'src')
-rw-r--r--src/net.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/net.h b/src/net.h
index 1aee973..600922a 100644
--- a/src/net.h
+++ b/src/net.h
@@ -841,7 +841,11 @@ public:
841 extern int nDropMessagesTest; 841 extern int nDropMessagesTest;
842 if (nDropMessagesTest > 0 && GetRand(nDropMessagesTest) == 0) 842 if (nDropMessagesTest > 0 && GetRand(nDropMessagesTest) == 0)
843 { 843 {
844 if (LogAcceptsCategory("net")) printf("dropmessages DROPPING SEND MESSAGE\n"); 844 // Same category as the "sending: " this line interrupts, so a tx
845 // does not announce its own drop under "net" having been gated
846 // off under "relay". nPushPos can be -1 here, and then
847 // GetMessageCommand() returns "" and this is "net" as before.
848 if (LogAcceptsCategory(SendLogCategory())) printf("dropmessages DROPPING SEND MESSAGE\n");
845 AbortMessage(); 849 AbortMessage();
846 return; 850 return;
847 } 851 }