Changeset View
Changeset View
Standalone View
Standalone View
src/qt/paymentserver.cpp
Show First 20 Lines • Show All 701 Lines • ▼ Show 20 Lines | void PaymentServer::fetchPaymentACK(WalletModel *walletModel, | ||||
if (walletModel->wallet().getKeyFromPool(false /* internal */, newKey)) { | if (walletModel->wallet().getKeyFromPool(false /* internal */, newKey)) { | ||||
// BIP70 requests encode the scriptPubKey directly, so we are not | // BIP70 requests encode the scriptPubKey directly, so we are not | ||||
// restricted to address types supported by the receiver. As a result, | // restricted to address types supported by the receiver. As a result, | ||||
// we choose the address format we also use for change. Despite an | // we choose the address format we also use for change. Despite an | ||||
// actual payment and not change, this is a close match: it's the output | // actual payment and not change, this is a close match: it's the output | ||||
// type we use subject to privacy issues, but not restricted by what | // type we use subject to privacy issues, but not restricted by what | ||||
// other software supports. | // other software supports. | ||||
const OutputType change_type = | const OutputType change_type = | ||||
g_change_type != OutputType::NONE ? g_change_type : g_address_type; | walletModel->wallet().getDefaultChangeType() != OutputType::NONE | ||||
? walletModel->wallet().getDefaultChangeType() | |||||
: walletModel->wallet().getDefaultAddressType(); | |||||
walletModel->wallet().learnRelatedScripts(newKey, change_type); | walletModel->wallet().learnRelatedScripts(newKey, change_type); | ||||
CTxDestination dest = GetDestinationForKey(newKey, change_type); | CTxDestination dest = GetDestinationForKey(newKey, change_type); | ||||
std::string label = tr("Refund from %1") | std::string label = tr("Refund from %1") | ||||
.arg(recipient.authenticatedMerchant) | .arg(recipient.authenticatedMerchant) | ||||
.toStdString(); | .toStdString(); | ||||
walletModel->wallet().setAddressBook(dest, label, "refund"); | walletModel->wallet().setAddressBook(dest, label, "refund"); | ||||
CScript s = GetScriptForDestination(dest); | CScript s = GetScriptForDestination(dest); | ||||
▲ Show 20 Lines • Show All 159 Lines • Show Last 20 Lines |