From cc21a1db50c14c0c41986e9137432e5ba8918b2d Mon Sep 17 00:00:00 2001 From: bitflash-maintainer Date: Wed, 2 Sep 2026 16:44:57 +0000 Subject: 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. --- src/net.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') 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: extern int nDropMessagesTest; if (nDropMessagesTest > 0 && GetRand(nDropMessagesTest) == 0) { - if (LogAcceptsCategory("net")) printf("dropmessages DROPPING SEND MESSAGE\n"); + // Same category as the "sending: " this line interrupts, so a tx + // does not announce its own drop under "net" having been gated + // off under "relay". nPushPos can be -1 here, and then + // GetMessageCommand() returns "" and this is "net" as before. + if (LogAcceptsCategory(SendLogCategory())) printf("dropmessages DROPPING SEND MESSAGE\n"); AbortMessage(); return; } -- cgit v1.2.3