Inside Bitcoin
Opening the selected file…
Inside Bitcoin
Opening the selected file…
The code behind the network, with room to understand it.
Release published 2026-10-28 · Snapshot fetched 2026-11-01. Latest stable release at fetch time; development branches and Git history are excluded. Only the selected code window and visible folders load here.
1// Copyright (c) 2011-present The Bitcoin Core developers2// Distributed under the MIT software license, see the accompanying3// file COPYING or http://www.opensource.org/licenses/mit-license.php.5#ifndef BITCOIN_QT_SENDCOINSRECIPIENT_H6#define BITCOIN_QT_SENDCOINSRECIPIENT_H8#include <consensus/amount.h>9#include <serialize.h>11#include <string>13#include <QString>15class SendCoinsRecipient16{17public:18explicit SendCoinsRecipient() : amount(0), fSubtractFeeFromAmount(false), nVersion(SendCoinsRecipient::CURRENT_VERSION) { }19explicit SendCoinsRecipient(const QString &addr, const QString &_label, const CAmount& _amount, const QString &_message):20address(addr), label(_label), amount(_amount), message(_message), fSubtractFeeFromAmount(false), nVersion(SendCoinsRecipient::CURRENT_VERSION) {}22// If from an unauthenticated payment request, this is used for storing23// the addresses, e.g. address-A<br />address-B<br />address-C.24// Info: As we don't need to process addresses in here when using25// payment requests, we can abuse it for displaying an address list.26// Todo: This is a hack, should be replaced with a cleaner solution!27QString address;28QString label;29CAmount amount;30// If from a payment request, this is used for storing the memo31QString message;32// Keep the payment request around as a serialized string to ensure33// load/store is lossless.34std::string sPaymentRequest;35// Empty if no authentication or invalid signature/cert/etc.36QString authenticatedMerchant;38bool fSubtractFeeFromAmount; // memory only40static constexpr int CURRENT_VERSION{1};41int nVersion;43SERIALIZE_METHODS(SendCoinsRecipient, obj)44{45std::string address_str, label_str, message_str, auth_merchant_str;47SER_WRITE(obj, address_str = obj.address.toStdString());48SER_WRITE(obj, label_str = obj.label.toStdString());49SER_WRITE(obj, message_str = obj.message.toStdString());50SER_WRITE(obj, auth_merchant_str = obj.authenticatedMerchant.toStdString());52READWRITE(obj.nVersion, address_str, label_str, obj.amount, message_str, obj.sPaymentRequest, auth_merchant_str);54SER_READ(obj, obj.address = QString::fromStdString(address_str));55SER_READ(obj, obj.label = QString::fromStdString(label_str));56SER_READ(obj, obj.message = QString::fromStdString(message_str));57SER_READ(obj, obj.authenticatedMerchant = QString::fromStdString(auth_merchant_str));58}59};61#endif // BITCOIN_QT_SENDCOINSRECIPIENT_H
Independent explanations by MyBitcoinExplorer. Not affiliated with or endorsed by Bitcoin Core. Guides are educational and do not replace the source or its tests.
Bitcoin Core source © its contributors, distributed under the MIT license. Original notices and bundled third-party licenses are retained in the source tree.