diff --git a/src/llmq/quorums_signing.cpp b/src/llmq/quorums_signing.cpp index f3d6323269d22..4ca640d1b395e 100644 --- a/src/llmq/quorums_signing.cpp +++ b/src/llmq/quorums_signing.cpp @@ -519,7 +519,11 @@ void CSigningManager::ProcessRecoveredSig(NodeId nodeId, const CRecoveredSig& re } CInv inv(MSG_QUORUM_RECOVERED_SIG, recoveredSig.GetHash()); - g_connman->RelayInv(inv, LLMQS_PROTO_VERSION); + g_connman->ForEachNode([&](CNode* pnode) { + if (pnode->nVersion >= LLMQS_PROTO_VERSION && pnode->fSendRecSigs) { + pnode->PushInventory(inv); + } + }); for (auto& l : listeners) { l->HandleNewRecoveredSig(recoveredSig); diff --git a/src/net.h b/src/net.h index 49fc0eb1ed19f..15b7fbe115d7a 100644 --- a/src/net.h +++ b/src/net.h @@ -817,8 +817,10 @@ class CNode // Whether a ping is requested. std::atomic fPingQueued; + // If true, we will announce/send him plain recovered sigs (usually true for full nodes) + std::atomic fSendRecSigs{false}; // If true, we will send him all quorum related messages, even if he is not a member of our quorums - std::atomic_bool qwatch{false}; + std::atomic qwatch{false}; CNode(NodeId id, ServiceFlags nLocalServicesIn, int nMyStartingHeightIn, SOCKET hSocketIn, const CAddress &addrIn, uint64_t nKeyedNetGroupIn, uint64_t nLocalHostNonceIn, const std::string &addrNameIn = "", bool fInboundIn = false); ~CNode(); diff --git a/src/net_processing.cpp b/src/net_processing.cpp index 70b5e45593aa3..fae46ddb85ef3 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -1681,6 +1681,14 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr connman.PushMessage(pfrom, msgMaker.Make(NetMsgType::SENDCMPCT, fAnnounceUsingCMPCTBLOCK, nCMPCTBLOCKVersion)); } + if (pfrom->nVersion >= LLMQS_PROTO_VERSION) { + // Tell our peer that we're interested in plain LLMQ recovered signatures. + // Otherwise the peer would only announce/send messages resulting from QRECSIG, + // e.g. InstantSend locks or ChainLocks. SPV nodes should not send this message + // as they are usually only interested in the higher level messages + connman.PushMessage(pfrom, msgMaker.Make(NetMsgType::QSENDRECSIGS, true)); + } + if (GetBoolArg("-watchquorums", llmq::DEFAULT_WATCH_QUORUMS)) { connman.PushMessage(pfrom, msgMaker.Make(NetMsgType::QWATCH)); } @@ -1763,6 +1771,13 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr } + else if (strCommand == NetMsgType::QSENDRECSIGS) { + bool b; + vRecv >> b; + pfrom->fSendRecSigs = b; + } + + else if (strCommand == NetMsgType::INV) { std::vector vInv; diff --git a/src/protocol.cpp b/src/protocol.cpp index 48407d640ef9c..1c93138666082 100644 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -58,6 +58,7 @@ const char *MNGOVERNANCEOBJECT="govobj"; const char *MNGOVERNANCEOBJECTVOTE="govobjvote"; const char *GETMNLISTDIFF="getmnlistd"; const char *MNLISTDIFF="mnlistdiff"; +const char *QSENDRECSIGS="qsendrecsigs"; const char *QFCOMMITMENT="qfcommit"; const char *QCONTRIB="qcontrib"; const char *QCOMPLAINT="qcomplaint"; @@ -161,6 +162,7 @@ const static std::string allNetMessageTypes[] = { NetMsgType::MNGOVERNANCEOBJECTVOTE, NetMsgType::GETMNLISTDIFF, NetMsgType::MNLISTDIFF, + NetMsgType::QSENDRECSIGS, NetMsgType::QFCOMMITMENT, NetMsgType::QCONTRIB, NetMsgType::QCOMPLAINT, diff --git a/src/protocol.h b/src/protocol.h index c2027b3e336e9..6bb8026c9575c 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -264,6 +264,7 @@ extern const char *MNGOVERNANCEOBJECT; extern const char *MNGOVERNANCEOBJECTVOTE; extern const char *GETMNLISTDIFF; extern const char *MNLISTDIFF; +extern const char *QSENDRECSIGS; extern const char *QFCOMMITMENT; extern const char *QCONTRIB; extern const char *QCOMPLAINT;