p2p: use a bool for send()

Identified by @selsta

Callers can otherwise misinterpret int -1 as truthy success,
e.g. see make_payload_send_txs

(cherry picked from commit 9bf193728bb11beb9c40e06a0d48d1c697fe7a84)
This commit is contained in:
j-berman
2026-10-04 18:50:22 -04:00
committed by such-gitea
parent a04ff495f7
commit f2a8c47410
4 changed files with 14 additions and 14 deletions
+2 -2
View File
@@ -2445,7 +2445,7 @@ TEST_F(levin_notify, command_max_bytes)
bytes = dest.finalize_notify(ping_command);
}
EXPECT_EQ(1, get_connections().send(bytes.clone(), contexts_.front().get_id()));
EXPECT_TRUE(get_connections().send(bytes.clone(), contexts_.front().get_id()));
EXPECT_EQ(1u, contexts_.front().process_send_queue(true));
EXPECT_EQ(1u, receiver_.notified_size());
@@ -2461,7 +2461,7 @@ TEST_F(levin_notify, command_max_bytes)
bytes = dest.finalize_notify(ping_command);
}
EXPECT_EQ(1, get_connections().send(std::move(bytes), contexts_.front().get_id()));
EXPECT_TRUE(get_connections().send(std::move(bytes), contexts_.front().get_id()));
EXPECT_EQ(1u, contexts_.front().process_send_queue(false));
EXPECT_EQ(0u, receiver_.notified_size());
}