Bitcoin Core  26.1.0
P2P Digital Currency
transaction.h
Go to the documentation of this file.
1 // Copyright (c) 2017-2022 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 <policy/feerate.h>
10 #include <util/error.h>
11 
12 class CBlockIndex;
13 class CTxMemPool;
14 namespace Consensus {
15 struct Params;
16 }
17 
18 namespace node {
19 class BlockManager;
20 struct NodeContext;
21 
28 
46 [[nodiscard]] TransactionError BroadcastTransaction(NodeContext& node, CTransactionRef tx, std::string& err_string, const CAmount& max_tx_fee, bool relay, bool wait_callback);
47 
60 CTransactionRef GetTransaction(const CBlockIndex* const block_index, const CTxMemPool* const mempool, const uint256& hash, uint256& hashBlock, const BlockManager& blockman);
61 } // namespace node
62 
63 #endif // BITCOIN_NODE_TRANSACTION_H
std::shared_ptr< const CTransaction > CTransactionRef
Definition: transaction.h:421
CTransactionRef GetTransaction(const CBlockIndex *const block_index, const CTxMemPool *const mempool, const uint256 &hash, uint256 &hashBlock, const BlockManager &blockman)
Return transaction with a given hash.
Transaction validation functions.
int64_t CAmount
Amount in satoshis (Can be negative)
Definition: amount.h:12
TransactionError BroadcastTransaction(NodeContext &node, const CTransactionRef tx, std::string &err_string, const CAmount &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:33
Definition: init.h:25
256-bit opaque blob.
Definition: uint256.h:106
CTxMemPool stores valid-according-to-the-current-best-chain transactions that may be included in the ...
Definition: txmempool.h:301
The block chain is a tree shaped structure starting with the genesis block at the root...
Definition: chain.h:144
const CChainParams & Params()
Return the currently selected parameters.
TransactionError
Definition: error.h:22
Fee rate in satoshis per kilovirtualbyte: CAmount / kvB.
Definition: feerate.h:32
static const CFeeRate DEFAULT_MAX_RAW_TX_FEE_RATE
Maximum fee rate for sendrawtransaction and testmempoolaccept RPC calls.
Definition: transaction.h:27
static constexpr CAmount COIN
The amount of satoshis in one BTC.
Definition: amount.h:15