aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Dashjr <luke-jr+git@utopios.org>2012-05-07 04:00:26 +0000
committerLuke Dashjr <luke-jr+git@utopios.org>2012-05-07 04:00:26 +0000
commit6bcefc1338c6e117219b56d8133a8ca0c055e210 (patch)
treeea4a4fe6e1eeb756e6ba1f210ca5df2d857cfeeb
parent457ff3a437a1b8907ba072001f935a8c67e9193a (diff)
parent293f2644ffd98742caa30b16405b95a6420e8ba0 (diff)
Merge commit '293f264' into 0.6.0.x
-rw-r--r--src/qt/bitcoin.cpp1
-rw-r--r--src/qt/walletmodel.cpp12
2 files changed, 10 insertions, 3 deletions
diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp
index c7f0092df9..9fea2c151e 100644
--- a/src/qt/bitcoin.cpp
+++ b/src/qt/bitcoin.cpp
@@ -287,6 +287,7 @@ int main(int argc, char *argv[])
#endif
app.exec();
+ window.hide();
guiref = 0;
}
Shutdown(NULL);
diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp
index 8344a653d5..0a085f5745 100644
--- a/src/qt/walletmodel.cpp
+++ b/src/qt/walletmodel.cpp
@@ -153,14 +153,20 @@ WalletModel::SendCoinsReturn WalletModel::sendCoins(const QList<SendCoinsRecipie
hex = QString::fromStdString(wtx.GetHash().GetHex());
}
- // Add addresses that we've sent to to the address book
+ // Add addresses / update labels that we've sent to to the address book
foreach(const SendCoinsRecipient &rcp, recipients)
{
std::string strAddress = rcp.address.toStdString();
+ std::string strLabel = rcp.label.toStdString();
CRITICAL_BLOCK(wallet->cs_wallet)
{
- if (!wallet->mapAddressBook.count(strAddress))
- wallet->SetAddressBookName(strAddress, rcp.label.toStdString());
+ std::map<CBitcoinAddress, std::string>::iterator mi = wallet->mapAddressBook.find(strAddress);
+
+ // Check if we have a new address or an updated label
+ if (mi == wallet->mapAddressBook.end() || mi->second != strLabel)
+ {
+ wallet->SetAddressBookName(strAddress, strLabel);
+ }
}
}