mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 20:12:57 +01:00
fix!: llmqTypeInstantSend deactivation prevention if used for other purposes (#4848)
This commit is contained in:
parent
d8cc65bd4d
commit
acb1dd6179
@ -536,6 +536,17 @@ bool CLLMQUtils::IsDIP0024Active(const CBlockIndex* pindex)
|
||||
return VersionBitsState(pindex, Params().GetConsensus(), Consensus::DEPLOYMENT_DIP0024, llmq_versionbitscache) == ThresholdState::ACTIVE;
|
||||
}
|
||||
|
||||
bool CLLMQUtils::IsInstantSendLLMQTypeShared()
|
||||
{
|
||||
if (Params().GetConsensus().llmqTypeInstantSend == Params().GetConsensus().llmqTypeChainLocks ||
|
||||
Params().GetConsensus().llmqTypeInstantSend == Params().GetConsensus().llmqTypePlatform ||
|
||||
Params().GetConsensus().llmqTypeInstantSend == Params().GetConsensus().llmqTypeMnhf) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
uint256 CLLMQUtils::DeterministicOutboundConnection(const uint256& proTxHash1, const uint256& proTxHash2)
|
||||
{
|
||||
// We need to deterministically select who is going to initiate the connection. The naive way would be to simply
|
||||
@ -755,6 +766,9 @@ bool CLLMQUtils::IsQuorumTypeEnabledInternal(Consensus::LLMQType llmqType, const
|
||||
{
|
||||
case Consensus::LLMQType::LLMQ_TEST_INSTANTSEND:
|
||||
case Consensus::LLMQType::LLMQ_50_60: {
|
||||
if (IsInstantSendLLMQTypeShared()) {
|
||||
break;
|
||||
}
|
||||
bool fDIP0024IsActive = optDIP0024IsActive.has_value() ? *optDIP0024IsActive : CLLMQUtils::IsDIP0024Active(pindex);
|
||||
if (fDIP0024IsActive) {
|
||||
bool fHaveDIP0024Quorums = optHaveDIP0024Quorums.has_value() ? *optHaveDIP0024Quorums
|
||||
|
@ -92,6 +92,7 @@ public:
|
||||
static Consensus::LLMQType GetInstantSendLLMQType(const CBlockIndex* pindex);
|
||||
static Consensus::LLMQType GetInstantSendLLMQType(bool deterministic);
|
||||
static bool IsDIP0024Active(const CBlockIndex* pindex);
|
||||
static bool IsInstantSendLLMQTypeShared();
|
||||
|
||||
/// Returns the state of `-llmq-data-recovery`
|
||||
static bool QuorumDataRecoveryEnabled();
|
||||
|
Loading…
Reference in New Issue
Block a user