Skip to content

Commit

Permalink
Refactor: fix layer violation for LLMQ based IS in UI (#2808)
Browse files Browse the repository at this point in the history
Ignoring the same issue for legacy IS because it's going to be removed later.
  • Loading branch information
UdjinM6 committed Mar 27, 2019
1 parent 614cb6c commit 4b4234f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/qt/transactiondesc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@

#include "instantx.h"

#include "llmq/quorums_instantsend.h"

#include <stdint.h>
#include <string>

Expand Down Expand Up @@ -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;
}

Expand Down
5 changes: 5 additions & 0 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions src/wallet/wallet.h
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ class CMerkleTx
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. */
Expand Down

0 comments on commit 4b4234f

Please sign in to comment.