aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2012-05-06 14:49:08 -0700
committerWladimir J. van der Laan <laanwj@gmail.com>2012-05-06 14:49:08 -0700
commit46692fc929bd024928ffbde6c5f5549d5fd1c45d (patch)
treecb6ab0a468839f44f959ed172524775f2c9aff0d
parent0e69fc6e84fb07ec3f911310455fe6520893e1d8 (diff)
parentdab7acdf4570e7b716cff02fb3d0550f142f747c (diff)
downloadbitcoin-46692fc929bd024928ffbde6c5f5549d5fd1c45d.tar.xz
Merge pull request #1189 from Diapolo/fix#952
fix for #952 (send coins tab glitch)
-rw-r--r--src/qt/walletmodel.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp
index a915274da3..b9ccb06c09 100644
--- a/src/qt/walletmodel.cpp
+++ b/src/qt/walletmodel.cpp
@@ -150,14 +150,21 @@ 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();
{
LOCK(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);
+ }
}
}