From 2e727de8eee3b65f87f6c5075de54980a7240b5d Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Mon, 15 Apr 2019 19:58:13 +0800 Subject: [PATCH] fix wallet crash --- src/wallet/walletdb.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wallet/walletdb.cpp b/src/wallet/walletdb.cpp index 3428b8b75..eab041d94 100644 --- a/src/wallet/walletdb.cpp +++ b/src/wallet/walletdb.cpp @@ -954,6 +954,7 @@ DBErrors CWalletDB::LoadWallet(CWallet* pwallet) if (!deadTxns.empty()) { int32_t reAdded = 0; + CWalletDB walletdb(pwallet->strWalletFile, "r+", false); BOOST_FOREACH (uint256& hash, deadTxns) { if (!EraseTx(hash)) fprintf(stderr, "could not delete tx.%s\n",hash.ToString().c_str()); @@ -961,7 +962,7 @@ DBErrors CWalletDB::LoadWallet(CWallet* pwallet) if (GetTransaction(hash,tx,blockhash,true)) { CWalletTx wtx(pwallet,tx); - pwallet->AddToWallet(wtx, false, NULL); + pwallet->AddToWallet(wtx, false, &walletdb); reAdded++; } }