AddToWallet implies BindWallet
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.
This commit is contained in:
parent
1d03869b42
commit
52861fb616
|
@ -473,6 +473,7 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn, bool fFromLoadWallet)
|
|||
if (fFromLoadWallet)
|
||||
{
|
||||
mapWallet[hash] = wtxIn;
|
||||
mapWallet[hash].BindWallet(this);
|
||||
AddToSpends(hash);
|
||||
}
|
||||
else
|
||||
|
|
|
@ -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;
|
||||
|
||||
if (wtx.nOrderPos == -1)
|
||||
|
|
Loading…
Reference in a new issue