528@@ -529,12 +529,11 @@ void MaybeSetPeerAsAnnouncingHeaderAndIDs(const CNodeState* nodestate, CNode* pf
529 if (lNodesAnnouncingHeaderAndIDs.size() >= 3) {
530 // As per BIP152, we only get 3 of our peers to announce
531 // blocks using compact encodings.
532- bool found = connman.ForNode(lNodesAnnouncingHeaderAndIDs.front(), [&connman, fAnnounceUsingCMPCTBLOCK, nCMPCTBLOCKVersion](CNode* pnodeStop){
533+ connman.ForNode(lNodesAnnouncingHeaderAndIDs.front(), [&connman, fAnnounceUsingCMPCTBLOCK, nCMPCTBLOCKVersion](CNode* pnodeStop){
534 connman.PushMessage(pnodeStop, NetMsgType::SENDCMPCT, fAnnounceUsingCMPCTBLOCK, nCMPCTBLOCKVersion);
535 return true;
Can this line go as well?
meh, the prototype of the lambda here is that it returns bool, just dropping the return should produce a warning that a function with a non-void return type can fail to return a value if the compiler is at all sane. Changing the prototype of ForNode seems unreasonable to me… the return value should be useful.
Since there’s only 1 user of ForNode, and since it’s terribly awkward for that use, I think we should just replace it by adding an extra:
0CConnman::PushMessage(NodeId id, ...);
We can do that as a follow-up to #9128.