We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e21d8d6 commit e47af29Copy full SHA for e47af29
src/wallet/rpcwallet.cpp
@@ -62,9 +62,13 @@ void EnsureWalletIsUnlocked(CWallet * const pwallet)
62
63
void WalletTxToJSON(const CWalletTx& wtx, UniValue& entry)
64
{
65
+ AssertLockHeld(cs_main); // for mapBlockIndex
66
int confirms = wtx.GetDepthInMainChain();
67
bool fLocked = instantsend.IsLockedInstantSendTransaction(wtx.GetHash());
- bool chainlock = llmq::chainLocksHandler->HasChainLock(wtx.nIndex, wtx.hashBlock);
68
+ bool chainlock = false;
69
+ if (confirms > 0) {
70
+ chainlock = llmq::chainLocksHandler->HasChainLock(mapBlockIndex[wtx.hashBlock]->nHeight, wtx.hashBlock);
71
+ }
72
entry.push_back(Pair("confirmations", confirms));
73
entry.push_back(Pair("instantlock", fLocked));
74
entry.push_back(Pair("chainlock", chainlock));
0 commit comments