Changeset View
Changeset View
Standalone View
Standalone View
src/qt/paymentserver.cpp
// Copyright (c) 2011-2016 The Bitcoin Core developers | // Copyright (c) 2011-2016 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#include <qt/paymentserver.h> | #include <qt/paymentserver.h> | ||||
#include <cashaddrenc.h> | |||||
#include <chainparams.h> | #include <chainparams.h> | ||||
#include <dstencode.h> | #include <dstencode.h> | ||||
#include <interfaces/node.h> | #include <interfaces/node.h> | ||||
#include <policy/policy.h> | #include <policy/policy.h> | ||||
#include <qt/bitcoinunits.h> | #include <qt/bitcoinunits.h> | ||||
#include <qt/guiutil.h> | #include <qt/guiutil.h> | ||||
#include <qt/optionsmodel.h> | #include <qt/optionsmodel.h> | ||||
#include <ui_interface.h> | #include <ui_interface.h> | ||||
▲ Show 20 Lines • Show All 580 Lines • ▼ Show 20 Lines | bool PaymentServer::processPaymentRequest(const PaymentRequestPlus &request, | ||||
QList<std::pair<CScript, Amount>> sendingTos = request.getPayTo(); | QList<std::pair<CScript, Amount>> sendingTos = request.getPayTo(); | ||||
QStringList addresses; | QStringList addresses; | ||||
for (const std::pair<CScript, Amount> &sendingTo : sendingTos) { | for (const std::pair<CScript, Amount> &sendingTo : sendingTos) { | ||||
// Extract and check destination addresses | // Extract and check destination addresses | ||||
CTxDestination dest; | CTxDestination dest; | ||||
if (ExtractDestination(sendingTo.first, dest)) { | if (ExtractDestination(sendingTo.first, dest)) { | ||||
// Append destination address | // Append destination address | ||||
addresses.append(QString::fromStdString(EncodeDestination(dest))); | addresses.append( | ||||
QString::fromStdString(EncodeCashAddr(dest, Params()))); | |||||
} else if (!recipient.authenticatedMerchant.isEmpty()) { | } else if (!recipient.authenticatedMerchant.isEmpty()) { | ||||
// Unauthenticated payment requests to custom bitcoin addresses are | // Unauthenticated payment requests to custom bitcoin addresses are | ||||
// not supported | // not supported | ||||
// (there is no good way to tell the user where they are paying in a | // (there is no good way to tell the user where they are paying in a | ||||
// way they'd | // way they'd | ||||
// have a chance of understanding). | // have a chance of understanding). | ||||
Q_EMIT message(tr("Payment request rejected"), | Q_EMIT message(tr("Payment request rejected"), | ||||
tr("Unverified payment requests to custom payment " | tr("Unverified payment requests to custom payment " | ||||
▲ Show 20 Lines • Show All 263 Lines • Show Last 20 Lines |