From b0091bb8961eb9c6eda1aabba7182794b3d0d477 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 10 Oct 2013 14:58:36 +0200 Subject: [PATCH] wallet: remove automatic update of default key --- src/wallet.cpp | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/src/wallet.cpp b/src/wallet.cpp index 26ffc71e..6ba91b66 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -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);