aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2014-04-19 08:51:32 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2014-04-19 08:51:40 +0200
commit913e90db9ad9d083e4f851e5e3f1139ff5524309 (patch)
treef8bc2628286781f3db1fa3d550042e717e7fc1b3
parentfe451fe9441c9b23e4a13a1f00974e29f7a30462 (diff)
parent09ec3af16687aa301a921a1a6e94d7a57d4af141 (diff)
Merge pull request #3701
09ec3af AddToWallet implies BindWallet (Wladimir J. van der Laan)
-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 775eb8f580..03a699a69c 100644
--- a/src/wallet.cpp
+++ b/src/wallet.cpp
@@ -471,6 +471,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