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.
This commit is contained in:
UdjinM6 2019-03-27 11:42:27 +03:00 committed by GitHub
parent 614cb6c2e6
commit 4b4234f390
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 4 deletions

View File

@ -21,8 +21,6 @@
#include "instantx.h"
#include "llmq/quorums_instantsend.h"
#include <stdint.h>
#include <string>
@ -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;
}

View File

@ -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);

View File

@ -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. */