From 7000ef1af3ddfc99bde07c185c781ea198d5eea5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Jul 2018 05:26:34 -1100 Subject: [PATCH] Possible workaround for crash --- src/wallet/wallet.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index ce5630fb6..e62c6e60b 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -1885,6 +1885,11 @@ void CWallet::ReacceptWalletTransactions() bool CWalletTx::RelayWalletTransaction() { + if ( pwallet == 0 ) + { + fprintf(stderr,"unexpected null pwallet in RelayWalletTransaction\n"); + return(false); + } assert(pwallet->GetBroadcastTransactions()); if (!IsCoinBase()) { @@ -2124,9 +2129,13 @@ std::vector CWallet::ResendWalletTransactionsBefore(int64_t nTime) } BOOST_FOREACH(PAIRTYPE(const unsigned int, CWalletTx*)& item, mapSorted) { - CWalletTx& wtx = *item.second; - if (wtx.RelayWalletTransaction()) - result.push_back(wtx.GetHash()); + CWalletTx& wtx; + if ( item.second != 0 ) + { + wtx = *item.second; + if (wtx.RelayWalletTransaction()) + result.push_back(wtx.GetHash()); + } } return result; }