Changeset View
Changeset View
Standalone View
Standalone View
src/qt/walletmodel.cpp
Show First 20 Lines • Show All 261 Lines • ▼ Show 20 Lines | for (const SendCoinsRecipient &rcp : transaction.getRecipients()) { | ||||
// Don't touch the address book when we have a payment request | // Don't touch the address book when we have a payment request | ||||
if (!rcp.paymentRequest.IsInitialized()) { | if (!rcp.paymentRequest.IsInitialized()) { | ||||
std::string strAddress = rcp.address.toStdString(); | std::string strAddress = rcp.address.toStdString(); | ||||
CTxDestination dest = | CTxDestination dest = | ||||
DecodeDestination(strAddress, getChainParams()); | DecodeDestination(strAddress, getChainParams()); | ||||
std::string strLabel = rcp.label.toStdString(); | std::string strLabel = rcp.label.toStdString(); | ||||
// Check if we have a new address or an updated label | // Check if we have a new address or an updated label | ||||
std::string name; | std::string name; | ||||
if (!m_wallet->getAddress(dest, &name)) { | if (!m_wallet->getAddress(dest, &name, /* is_mine= */ nullptr, | ||||
/* purpose= */ nullptr)) { | |||||
m_wallet->setAddressBook(dest, strLabel, "send"); | m_wallet->setAddressBook(dest, strLabel, "send"); | ||||
} else if (name != strLabel) { | } else if (name != strLabel) { | ||||
// "" means don't change purpose | // "" means don't change purpose | ||||
m_wallet->setAddressBook(dest, strLabel, ""); | m_wallet->setAddressBook(dest, strLabel, ""); | ||||
} | } | ||||
} | } | ||||
Q_EMIT coinsSent(this, rcp, transaction_array); | Q_EMIT coinsSent(this, rcp, transaction_array); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 200 Lines • Show Last 20 Lines |