From: Philip Kaufmann Date: Thu, 3 May 2012 12:52:15 +0000 (+0200) Subject: fix #952 by checking if we have a new address or an updated label X-Git-Tag: v0.4.0-unstable~129^2~1^2^2~13^2 X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=commitdiff_plain;h=293f2644ffd98742caa30b16405b95a6420e8ba0 fix #952 by checking if we have a new address or an updated label --- diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp index f028f10..710d3aa 100644 --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -152,14 +152,20 @@ WalletModel::SendCoinsReturn WalletModel::sendCoins(const QListcs_wallet) { - if (!wallet->mapAddressBook.count(strAddress)) - wallet->SetAddressBookName(strAddress, rcp.label.toStdString()); + std::map::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); + } } }