diff options
| author | Jeff Garzik <[email protected]> | 2013-06-05 10:56:24 -0700 |
|---|---|---|
| committer | Jeff Garzik <[email protected]> | 2013-06-05 10:56:24 -0700 |
| commit | c94bd68547df9ba7645305f9813e02d548e8a981 (patch) | |
| tree | b29f008e3a4dcc44a349ca93616c4e804a709ee5 /src/wallet.cpp | |
| parent | Merge pull request #2731 from Diapolo/rpcconsole (diff) | |
| parent | build: kill off the QT_GUI define (diff) | |
| download | discoin-c94bd68547df9ba7645305f9813e02d548e8a981.tar.xz discoin-c94bd68547df9ba7645305f9813e02d548e8a981.zip | |
Merge pull request #2700 from theuni/gui-split
autotools: Gui split
Diffstat (limited to 'src/wallet.cpp')
| -rw-r--r-- | src/wallet.cpp | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/src/wallet.cpp b/src/wallet.cpp index 27aab08ec..549d9bbf4 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -459,25 +459,26 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn) if (fInsertedNew || fUpdated) if (!wtx.WriteToDisk()) return false; -#ifndef QT_GUI - // 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 (!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) { - 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(), ""); + } } } } } -#endif // since AddToWallet is called directly for self-originating transactions, check for consumption of own coins WalletUpdateSpent(wtx); |