Skip to content

Commit

Permalink
Don't show untrusted txs in account history (#711)
Browse files Browse the repository at this point in the history
Signed-off-by: Anthony Fieroni <[email protected]>
  • Loading branch information
bvbfan authored Oct 22, 2021
1 parent 470cfd5 commit 89a7fbe
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/masternodes/rpc_accounts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ static void searchInWallet(CWallet const * pwallet,
std::list<COutputEntry> listSent;
std::list<COutputEntry> listReceived;

LOCK(pwallet->cs_wallet);
auto locked_chain = pwallet->chain().lock();
LOCK2(pwallet->cs_wallet, locked_chain->mutex());

const auto& txOrdered = pwallet->mapWallet.get<ByOrder>();

Expand All @@ -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) {
Expand Down

0 comments on commit 89a7fbe

Please sign in to comment.