diff --git a/src/masternodes/rpc_accounts.cpp b/src/masternodes/rpc_accounts.cpp index 262b1456a64..ffddce3b976 100644 --- a/src/masternodes/rpc_accounts.cpp +++ b/src/masternodes/rpc_accounts.cpp @@ -134,7 +134,8 @@ static void searchInWallet(CWallet const * pwallet, std::list listSent; std::list listReceived; - LOCK(pwallet->cs_wallet); + auto locked_chain = pwallet->chain().lock(); + LOCK2(pwallet->cs_wallet, locked_chain->mutex()); const auto& txOrdered = pwallet->mapWallet.get(); @@ -150,6 +151,10 @@ static void searchInWallet(CWallet const * pwallet, continue; } + if (!pwtx->IsTrusted(*locked_chain)) { + continue; + } + pwtx->GetAmounts(listReceived, listSent, nFee, filter); for (auto& sent : listSent) {