diff --git a/src/llmq/instantsend.cpp b/src/llmq/instantsend.cpp index 9648786c59..bf2622ec3b 100644 --- a/src/llmq/instantsend.cpp +++ b/src/llmq/instantsend.cpp @@ -787,7 +787,7 @@ void CInstantSendManager::ProcessMessageInstantSendLock(const CNode* pfrom, cons fDIP0024IsActive = utils::IsDIP0024Active(::ChainActive().Tip()); } - if (!PreVerifyInstantSendLock(*islock)) { + if (!islock->TriviallyValid()) { LOCK(cs_main); Misbehaving(pfrom->GetId(), 100); return; @@ -830,18 +830,17 @@ void CInstantSendManager::ProcessMessageInstantSendLock(const CNode* pfrom, cons /** * Handles trivial ISLock verification - * @param islock The islock message being undergoing verification * @return returns false if verification failed, otherwise true */ -bool CInstantSendManager::PreVerifyInstantSendLock(const llmq::CInstantSendLock& islock) +bool CInstantSendLock::TriviallyValid() const { - if (islock.txid.IsNull() || islock.inputs.empty()) { + if (txid.IsNull() || inputs.empty()) { return false; } // Check that each input is unique std::set dups; - for (const auto& o : islock.inputs) { + for (const auto& o : inputs) { if (!dups.emplace(o).second) { return false; } diff --git a/src/llmq/instantsend.h b/src/llmq/instantsend.h index f6d040a786..a345421bee 100644 --- a/src/llmq/instantsend.h +++ b/src/llmq/instantsend.h @@ -58,6 +58,7 @@ struct CInstantSendLock uint256 GetRequestId() const; bool IsDeterministic() const { return nVersion != islock_version; } + bool TriviallyValid() const; }; using CInstantSendLockPtr = std::shared_ptr; @@ -280,7 +281,6 @@ private: void TrySignInstantSendLock(const CTransaction& tx) LOCKS_EXCLUDED(cs_creating); void ProcessMessageInstantSendLock(const CNode* pfrom, const CInstantSendLockPtr& islock); - static bool PreVerifyInstantSendLock(const CInstantSendLock& islock); bool ProcessPendingInstantSendLocks(); bool ProcessPendingInstantSendLocks(bool deterministic) LOCKS_EXCLUDED(cs_pendingLocks);