Bitcoin ABC  0.26.3
P2P Digital Currency
transaction.h
Go to the documentation of this file.
1 // Copyright (c) 2017-2019 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #ifndef BITCOIN_NODE_TRANSACTION_H
6 #define BITCOIN_NODE_TRANSACTION_H
7 
8 #include <attributes.h>
9 #include <feerate.h>
10 #include <primitives/transaction.h>
11 #include <util/error.h>
12 
13 struct BlockHash;
14 class CBlockIndex;
15 class Config;
16 class CTxMemPool;
17 struct TxId;
18 
19 namespace Consensus {
20 struct Params;
21 }
22 
23 namespace node {
24 struct NodeContext;
25 
34 
56 [[nodiscard]] TransactionError
57 BroadcastTransaction(NodeContext &node, const Config &config,
58  CTransactionRef tx, std::string &err_string,
59  Amount max_tx_fee, bool relay, bool wait_callback);
60 
77 CTransactionRef GetTransaction(const CBlockIndex *const block_index,
78  const CTxMemPool *const mempool,
79  const TxId &txid,
80  const Consensus::Params &consensusParams,
81  BlockHash &hashBlock);
82 } // namespace node
83 
84 #endif // BITCOIN_NODE_TRANSACTION_H
static constexpr Amount COIN
Definition: amount.h:154
const CChainParams & Params()
Return the currently selected parameters.
The block chain is a tree shaped structure starting with the genesis block at the root,...
Definition: blockindex.h:26
Fee rate in satoshis per kilobyte: Amount / kB.
Definition: feerate.h:21
CTxMemPool stores valid-according-to-the-current-best-chain transactions that may be included in the ...
Definition: txmempool.h:438
Definition: config.h:17
TransactionError
Definition: error.h:22
Definition: init.h:28
TransactionError BroadcastTransaction(NodeContext &node, const Config &config, const CTransactionRef tx, std::string &err_string, const Amount max_tx_fee, bool relay, bool wait_callback)
Submit a transaction to the mempool and (optionally) relay it to all P2P peers.
Definition: transaction.cpp:37
CTransactionRef GetTransaction(const CBlockIndex *const block_index, const CTxMemPool *const mempool, const TxId &txid, const Consensus::Params &consensusParams, BlockHash &hashBlock)
Return transaction with a given txid.
static const CFeeRate DEFAULT_MAX_RAW_TX_FEE_RATE
Maximum fee rate for sendrawtransaction and testmempoolaccept RPC calls.
Definition: transaction.h:33
std::shared_ptr< const CTransaction > CTransactionRef
Definition: transaction.h:319
Definition: amount.h:19
A BlockHash is a unqiue identifier for a block.
Definition: blockhash.h:13
Parameters that influence chain consensus.
Definition: params.h:76
A TxId is the identifier of a transaction.
Definition: txid.h:14