From ee4b170c929b0f0d0b5a9fcaa0c35c79e9ac157c Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Sun, 26 May 2013 14:17:18 -0400 Subject: build: use runtime setting for wallet rather than QT_GUI define --- src/wallet.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/wallet.cpp') diff --git a/src/wallet.cpp b/src/wallet.cpp index 27aab08ec..17a35d940 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -459,7 +459,8 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn) if (fInsertedNew || fUpdated) if (!wtx.WriteToDisk()) return false; -#ifndef QT_GUI + + if (!fHaveGUI) { // If default receiving address gets used, replace it with a new one if (vchDefaultKey.IsValid()) { CScript scriptDefaultKey; @@ -477,7 +478,7 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn) } } } -#endif + } // since AddToWallet is called directly for self-originating transactions, check for consumption of own coins WalletUpdateSpent(wtx); -- cgit v1.2.3 From 34994ebcb0cb5164f515266ebc5524a9608cb1c8 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Sun, 26 May 2013 14:18:33 -0400 Subject: build: cosmetics after last commit --- src/wallet.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/wallet.cpp') diff --git a/src/wallet.cpp b/src/wallet.cpp index 17a35d940..549d9bbf4 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -461,24 +461,24 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn) 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) + // 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) { - CPubKey newDefaultKey; - if (GetKeyFromPool(newDefaultKey, false)) + if (txout.scriptPubKey == scriptDefaultKey) { - SetDefaultKey(newDefaultKey); - SetAddressBookName(vchDefaultKey.GetID(), ""); + CPubKey newDefaultKey; + if (GetKeyFromPool(newDefaultKey, false)) + { + SetDefaultKey(newDefaultKey); + SetAddressBookName(vchDefaultKey.GetID(), ""); + } } } } } - } // since AddToWallet is called directly for self-originating transactions, check for consumption of own coins WalletUpdateSpent(wtx); -- cgit v1.2.3