mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-12 04:42:36 -03:00
Merge pull request #1189 from Diapolo/fix#952
fix for #952 (send coins tab glitch)
This commit is contained in:
commit
46692fc929
1 changed files with 10 additions and 3 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue