aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/wallet.cpp1
-rw-r--r--src/walletdb.cpp4
2 files changed, 2 insertions, 3 deletions
diff --git a/src/wallet.cpp b/src/wallet.cpp
index 3ecd994e9d..352e2a776e 100644
--- a/src/wallet.cpp
+++ b/src/wallet.cpp
@@ -470,6 +470,7 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn, bool fFromLoadWallet)
if (fFromLoadWallet)
{
mapWallet[hash] = wtxIn;
+ mapWallet[hash].BindWallet(this);
AddToSpends(hash);
}
else
diff --git a/src/walletdb.cpp b/src/walletdb.cpp
index b57ea0b518..359a1cef61 100644
--- a/src/walletdb.cpp
+++ b/src/walletdb.cpp
@@ -352,9 +352,7 @@ ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue,
CWalletTx wtx;
ssValue >> wtx;
CValidationState state;
- if (CheckTransaction(wtx, state) && (wtx.GetHash() == hash) && state.IsValid())
- wtx.BindWallet(pwallet);
- else
+ if (!(CheckTransaction(wtx, state) && (wtx.GetHash() == hash) && state.IsValid()))
return false;
// Undo serialize changes in 31600