|
|
@ -483,25 +483,6 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn) |
|
|
|
if (!wtx.WriteToDisk()) |
|
|
|
if (!wtx.WriteToDisk()) |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
|
|
if (!fHaveGUI) { |
|
|
|
|
|
|
|
// If default receiving address gets used, replace it with a new one
|
|
|
|
|
|
|
|
if (vchDefaultKey.IsValid()) { |
|
|
|
|
|
|
|
CScript scriptDefaultKey; |
|
|
|
|
|
|
|
scriptDefaultKey.SetDestination(vchDefaultKey.GetID()); |
|
|
|
|
|
|
|
BOOST_FOREACH(const CTxOut& txout, wtx.vout) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (txout.scriptPubKey == scriptDefaultKey) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
CPubKey newDefaultKey; |
|
|
|
|
|
|
|
if (GetKeyFromPool(newDefaultKey)) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
SetDefaultKey(newDefaultKey); |
|
|
|
|
|
|
|
SetAddressBook(vchDefaultKey.GetID(), "", "receive"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// since AddToWallet is called directly for self-originating transactions, check for consumption of own coins
|
|
|
|
// since AddToWallet is called directly for self-originating transactions, check for consumption of own coins
|
|
|
|
WalletUpdateSpent(wtx); |
|
|
|
WalletUpdateSpent(wtx); |
|
|
|
|
|
|
|
|
|
|
|