From 4b4234f390bb9d551b608db0b400fc485f9bc3a2 Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Wed, 27 Mar 2019 11:42:27 +0300 Subject: [PATCH] Refactor: fix layer violation for LLMQ based IS in UI (#2808) Ignoring the same issue for legacy IS because it's going to be removed later. --- src/qt/transactiondesc.cpp | 6 ++---- src/wallet/wallet.cpp | 5 +++++ src/wallet/wallet.h | 1 + 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/qt/transactiondesc.cpp b/src/qt/transactiondesc.cpp index d2578bc09..a3814bc79 100644 --- a/src/qt/transactiondesc.cpp +++ b/src/qt/transactiondesc.cpp @@ -21,8 +21,6 @@ #include "instantx.h" -#include "llmq/quorums_instantsend.h" - #include #include @@ -59,8 +57,8 @@ QString TransactionDesc::FormatTxStatus(const CWalletTx& wtx) } } - if (llmq::quorumInstantSendManager->IsLocked(wtx.GetHash())) { - strTxStatus += tr(" (verified via LLMQ based InstantSend)"); + if (wtx.IsLockedByLLMQInstantSend()) { + strTxStatus += " (" + tr("verified via LLMQ based InstantSend") + ")"; return strTxStatus; } diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 34e4b4e8b..48311ed2e 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -5405,6 +5405,11 @@ bool CMerkleTx::IsLockedByInstantSend() const return instantsend.IsLockedInstantSendTransaction(GetHash()) || llmq::quorumInstantSendManager->IsLocked(GetHash()); } +bool CMerkleTx::IsLockedByLLMQInstantSend() const +{ + return llmq::quorumInstantSendManager->IsLocked(GetHash()); +} + bool CMerkleTx::IsChainLocked() const { AssertLockHeld(cs_main); diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index 8f6d4a512..80fcf1ddd 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -271,6 +271,7 @@ public: int GetDepthInMainChain() const { const CBlockIndex *pindexRet; return GetDepthInMainChain(pindexRet); } bool IsInMainChain() const { const CBlockIndex *pindexRet; return GetDepthInMainChain(pindexRet) > 0; } bool IsLockedByInstantSend() const; + bool IsLockedByLLMQInstantSend() const; bool IsChainLocked() const; int GetBlocksToMaturity() const; /** Pass this transaction to the mempool. Fails if absolute fee exceeds absurd fee. */