]> Git Repo - VerusCoin.git/commitdiff
AddToWallet implies BindWallet
authorWladimir J. van der Laan <[email protected]>
Tue, 18 Feb 2014 14:23:24 +0000 (15:23 +0100)
committerWladimir J. van der Laan <[email protected]>
Fri, 7 Mar 2014 08:20:11 +0000 (09:20 +0100)
Now that AddToWallet is called when loading transactions from the
wallet database, BindWallet can be integrated into that and does not
need to be an extra step.

Leaves behaviour unchanged, but makes the
fFromLoadWallet/!fFromLoadWallet paths in AddToWallet a bit more
symmetric.

src/wallet.cpp
src/walletdb.cpp

index 3ecd994e9dd0505c886ff48f9124c912e93f749a..352e2a776e6ff795b43eb8c63cd4ae859b4c0126 100644 (file)
@@ -470,6 +470,7 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn, bool fFromLoadWallet)
     if (fFromLoadWallet)
     {
         mapWallet[hash] = wtxIn;
+        mapWallet[hash].BindWallet(this);
         AddToSpends(hash);
     }
     else
index b57ea0b5189932f0d6927de729c13b0725b1d3c6..359a1cef61be1443c3ad6a5c6049ac098ca16e4c 100644 (file)
@@ -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
This page took 0.030533 seconds and 4 git commands to generate.