mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
CValidationInterface: modify the parameter of TransactionAddedToMempool
Create a new struct `NewMempoolTransactionInfo` that will be used as the new parameter of `TransactionAddedToMempool` callback.
This commit is contained in:
@@ -55,13 +55,13 @@ struct OutpointsUpdater final : public CValidationInterface {
|
||||
explicit OutpointsUpdater(std::set<COutPoint>& r)
|
||||
: m_mempool_outpoints{r} {}
|
||||
|
||||
void TransactionAddedToMempool(const CTransactionRef& tx, uint64_t /* mempool_sequence */) override
|
||||
void TransactionAddedToMempool(const NewMempoolTransactionInfo& tx, uint64_t /* mempool_sequence */) override
|
||||
{
|
||||
// for coins spent we always want to be able to rbf so they're not removed
|
||||
|
||||
// outputs from this tx can now be spent
|
||||
for (uint32_t index{0}; index < tx->vout.size(); ++index) {
|
||||
m_mempool_outpoints.insert(COutPoint{tx->GetHash(), index});
|
||||
for (uint32_t index{0}; index < tx.info.m_tx->vout.size(); ++index) {
|
||||
m_mempool_outpoints.insert(COutPoint{tx.info.m_tx->GetHash(), index});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,10 +85,10 @@ struct TransactionsDelta final : public CValidationInterface {
|
||||
explicit TransactionsDelta(std::set<CTransactionRef>& a)
|
||||
: m_added{a} {}
|
||||
|
||||
void TransactionAddedToMempool(const CTransactionRef& tx, uint64_t /* mempool_sequence */) override
|
||||
void TransactionAddedToMempool(const NewMempoolTransactionInfo& tx, uint64_t /* mempool_sequence */) override
|
||||
{
|
||||
// Transactions may be entered and booted any number of times
|
||||
m_added.insert(tx);
|
||||
m_added.insert(tx.info.m_tx);
|
||||
}
|
||||
|
||||
void TransactionRemovedFromMempool(const CTransactionRef& tx, MemPoolRemovalReason reason, uint64_t /* mempool_sequence */) override
|
||||
|
||||
Reference in New Issue
Block a user