|
25 | 25 | #include <algorithm> |
26 | 26 | #include <unordered_set> |
27 | 27 |
|
| 28 | +#include "options.h" |
| 29 | + |
28 | 30 | namespace llmq |
29 | 31 | { |
30 | 32 | CRecoveredSigsDb::CRecoveredSigsDb(const util::DbWrapperParams& db_params) : |
@@ -508,7 +510,7 @@ void CSigningManager::ProcessPendingReconstructedRecoveredSigs(PeerManager& peer |
508 | 510 | WITH_LOCK(cs_pending, swap(m, pendingReconstructedRecoveredSigs)); |
509 | 511 |
|
510 | 512 | for (const auto& p : m) { |
511 | | - ProcessRecoveredSig(p.second, peerman); |
| 513 | + ProcessRecoveredSig(p.second, peerman, -1); |
512 | 514 | } |
513 | 515 | } |
514 | 516 |
|
@@ -570,15 +572,15 @@ bool CSigningManager::ProcessPendingRecoveredSigs(PeerManager& peerman) |
570 | 572 | continue; |
571 | 573 | } |
572 | 574 |
|
573 | | - ProcessRecoveredSig(recSig, peerman); |
| 575 | + ProcessRecoveredSig(recSig, peerman, nodeId); |
574 | 576 | } |
575 | 577 | } |
576 | 578 |
|
577 | 579 | return recSigsByNode.size() >= nMaxBatchSize; |
578 | 580 | } |
579 | 581 |
|
580 | 582 | // signature must be verified already |
581 | | -void CSigningManager::ProcessRecoveredSig(const std::shared_ptr<const CRecoveredSig>& recoveredSig, PeerManager& peerman) |
| 583 | +void CSigningManager::ProcessRecoveredSig(const std::shared_ptr<const CRecoveredSig>& recoveredSig, PeerManager& peerman, NodeId from) |
582 | 584 | { |
583 | 585 | auto llmqType = recoveredSig->getLlmqType(); |
584 | 586 |
|
@@ -621,7 +623,12 @@ void CSigningManager::ProcessRecoveredSig(const std::shared_ptr<const CRecovered |
621 | 623 | peerman.PostProcessMessage(l->HandleNewRecoveredSig(*recoveredSig)); |
622 | 624 | } |
623 | 625 |
|
624 | | - GetMainSignals().NotifyRecoveredSig(recoveredSig, recoveredSig->GetHash().ToString()); |
| 626 | + // TODO refactor to use a better abstraction analogous to IsAllMembersConnectedEnabled |
| 627 | + auto proactive_relay = from == -1 && |
| 628 | + llmqType != Consensus::LLMQType::LLMQ_100_67 && |
| 629 | + llmqType != Consensus::LLMQType::LLMQ_400_60 && |
| 630 | + llmqType != Consensus::LLMQType::LLMQ_400_85; |
| 631 | + GetMainSignals().NotifyRecoveredSig(recoveredSig, recoveredSig->GetHash().ToString(), proactive_relay); |
625 | 632 | } |
626 | 633 |
|
627 | 634 | void CSigningManager::PushReconstructedRecoveredSig(const std::shared_ptr<const llmq::CRecoveredSig>& recoveredSig) |
|
0 commit comments