diff options
author | ismaelsadeeq <ask4ismailsadiq@gmail.com> | 2023-11-03 17:04:30 +0100 |
---|---|---|
committer | ismaelsadeeq <ask4ismailsadiq@gmail.com> | 2023-11-22 11:48:21 +0100 |
commit | dff5ad3b9944cbb56126ba37a8da180d1327ba39 (patch) | |
tree | e09e69e7bc862ad75067046f3e023f49559d8e5d /src/kernel | |
parent | 91532bd38223d7d04166e05de11d0d0b55e60f13 (diff) | |
download | bitcoin-dff5ad3b9944cbb56126ba37a8da180d1327ba39.tar.xz |
CValidationInterface: modify the parameter of `TransactionAddedToMempool`
Create a new struct `NewMempoolTransactionInfo` that will be used as the new parameter of
`TransactionAddedToMempool` callback.
Diffstat (limited to 'src/kernel')
-rw-r--r-- | src/kernel/mempool_entry.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/kernel/mempool_entry.h b/src/kernel/mempool_entry.h index ce32fe20dc..5824a4576b 100644 --- a/src/kernel/mempool_entry.h +++ b/src/kernel/mempool_entry.h @@ -208,4 +208,33 @@ struct RemovedMempoolTransactionInfo { : info{entry.GetSharedTx(), entry.GetFee(), entry.GetTxSize(), entry.GetHeight()} {} }; +struct NewMempoolTransactionInfo { + TransactionInfo info; + /* + * This boolean indicates whether the transaction was added + * without enforcing mempool fee limits. + */ + const bool m_from_disconnected_block; + /* This boolean indicates whether the transaction is part of a package. */ + const bool m_submitted_in_package; + /* + * This boolean indicates whether the blockchain is up to date when the + * transaction is added to the mempool. + */ + const bool m_chainstate_is_current; + /* Indicates whether the transaction has unconfirmed parents. */ + const bool m_has_no_mempool_parents; + + explicit NewMempoolTransactionInfo(const CTransactionRef& tx, const CAmount& fee, + const int64_t vsize, const unsigned int height, + const bool from_disconnected_block, const bool submitted_in_package, + const bool chainstate_is_current, + const bool has_no_mempool_parents) + : info{tx, fee, vsize, height}, + m_from_disconnected_block{from_disconnected_block}, + m_submitted_in_package{submitted_in_package}, + m_chainstate_is_current{chainstate_is_current}, + m_has_no_mempool_parents{has_no_mempool_parents} {} +}; + #endif // BITCOIN_KERNEL_MEMPOOL_ENTRY_H |