From 136459133d4a37e1119863df723e381fd5a031ef Mon Sep 17 00:00:00 2001 From: lateminer Date: Wed, 20 Mar 2019 22:56:22 +0300 Subject: [PATCH] Fix logic in ReacceptWalletTransactions(), RelayWalletTransaction() and GetAddressBalances() --- src/wallet/wallet.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index c701d5274..6da25b886 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -1769,7 +1769,7 @@ void CWallet::ReacceptWalletTransactions() int nDepth = wtx.GetDepthInMainChain(); - if (!wtx.IsCoinBase() && !wtx.IsCoinStake() && (nDepth == 0 && !wtx.isAbandoned())) { + if (!(wtx.IsCoinBase() || wtx.IsCoinStake()) && (nDepth == 0 && !wtx.isAbandoned())) { mapSorted.insert(std::make_pair(wtx.nOrderPos, &wtx)); } } @@ -1788,7 +1788,7 @@ void CWallet::ReacceptWalletTransactions() bool CWalletTx::RelayWalletTransaction() { assert(pwallet->GetBroadcastTransactions()); - if (!IsCoinBase() && !IsCoinStake() && !isAbandoned() && GetDepthInMainChain() == 0) + if (!(IsCoinBase() || IsCoinStake()) && !isAbandoned() && GetDepthInMainChain() == 0) { CValidationState state; /* GetDepthInMainChain already catches known conflicts. */ @@ -3223,7 +3223,7 @@ std::map CWallet::GetAddressBalances() if (!CheckFinalTx(*pcoin) || !pcoin->IsTrusted()) continue; - if (pcoin->IsCoinBase() && pcoin->GetBlocksToMaturity() > 0) + if ((pcoin->IsCoinBase() || pcoin->IsCoinStake()) && pcoin->GetBlocksToMaturity() > 0) continue; int nDepth = pcoin->GetDepthInMainChain();