Changeset View
Changeset View
Standalone View
Standalone View
src/node/transaction.h
// Copyright (c) 2017-2018 The Bitcoin Core developers | // Copyright (c) 2017-2019 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. | ||||
#ifndef BITCOIN_NODE_TRANSACTION_H | #ifndef BITCOIN_NODE_TRANSACTION_H | ||||
#define BITCOIN_NODE_TRANSACTION_H | #define BITCOIN_NODE_TRANSACTION_H | ||||
#include <attributes.h> | |||||
#include <primitives/transaction.h> | #include <primitives/transaction.h> | ||||
#include <util/error.h> | #include <util/error.h> | ||||
class Config; | class Config; | ||||
struct TxId; | struct TxId; | ||||
/** | /** | ||||
* Broadcast a transaction | * Broadcast a transaction | ||||
* | * | ||||
* @param[in] tx the transaction to broadcast | * @param[in] tx the transaction to broadcast | ||||
* @param[out] &txid the txid of the transaction, if successfully broadcast | * @param[out] &txid the txid of the transaction, if successfully broadcast | ||||
* @param[out] &error reference to UniValue to fill with error info on failure | * @param[out] &err_string reference to std::string to fill with error string | ||||
* @param[out] &err_string reference to std::string to fill with error string if | * if available | ||||
* available | * @param[in] highfee Reject txs with fees higher than this (if 0, accept any | ||||
* @param[in] allowhighfees whether to allow fees exceeding maxTxFee | * fee) | ||||
* return true on success, false on error (and fills in `error`) | * @return error | ||||
*/ | */ | ||||
bool BroadcastTransaction(const Config &config, CTransactionRef tx, TxId &txid, | NODISCARD TransactionError BroadcastTransaction(const Config &config, | ||||
TransactionError &error, std::string &err_string, | CTransactionRef tx, TxId &txid, | ||||
bool allowhighfees = false); | std::string &err_string, | ||||
Amount highfee); | |||||
#endif // BITCOIN_NODE_TRANSACTION_H | #endif // BITCOIN_NODE_TRANSACTION_H |