Browse Source

Merge pull request #3074 from laanwj/2013_10_remove_default_key_1

Remove automatic update of default key
0.10
Gavin Andresen 11 years ago
parent
commit
496c2a3542
  1. 19
      src/wallet.cpp

19
src/wallet.cpp

@ -483,25 +483,6 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn) @@ -483,25 +483,6 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn)
if (!wtx.WriteToDisk())
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
WalletUpdateSpent(wtx);

Loading…
Cancel
Save