From 5cbe24202a6ba0b7780fcaa3a4530d46612f02da Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Thu, 3 May 2012 14:52:15 +0200 Subject: [PATCH] fix #952 by checking if we have a new address or an updated label --- src/qt/walletmodel.cpp | 13 ++++++++++--- 1 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp index a915274..b9ccb06 100644 --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -150,14 +150,21 @@ 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); + } } } -- 1.7.1