diff --git a/src/coinjoin/coinjoin.cpp b/src/coinjoin/coinjoin.cpp index cbae86edd3..39a703fdff 100644 --- a/src/coinjoin/coinjoin.cpp +++ b/src/coinjoin/coinjoin.cpp @@ -494,13 +494,10 @@ void CCoinJoin::TransactionAddedToMempool(const CTransactionRef& tx) UpdateDSTXConfirmedHeight(tx, -1); } -void CCoinJoin::BlockConnected(const std::shared_ptr& pblock, const CBlockIndex* pindex, const std::vector& vtxConflicted) +void CCoinJoin::BlockConnected(const std::shared_ptr& pblock, const CBlockIndex* pindex) { AssertLockNotHeld(cs_mapdstx); LOCK(cs_mapdstx); - for (const auto& tx : vtxConflicted) { - UpdateDSTXConfirmedHeight(tx, -1); - } for (const auto& tx : pblock->vtx) { UpdateDSTXConfirmedHeight(tx, pindex->nHeight); diff --git a/src/coinjoin/coinjoin.h b/src/coinjoin/coinjoin.h index e74a853743..71593004b0 100644 --- a/src/coinjoin/coinjoin.h +++ b/src/coinjoin/coinjoin.h @@ -506,7 +506,7 @@ public: static void UpdateDSTXConfirmedHeight(const CTransactionRef& tx, int nHeight); static void TransactionAddedToMempool(const CTransactionRef& tx) LOCKS_EXCLUDED(cs_mapdstx); - static void BlockConnected(const std::shared_ptr& pblock, const CBlockIndex* pindex, const std::vector& vtxConflicted) LOCKS_EXCLUDED(cs_mapdstx); + static void BlockConnected(const std::shared_ptr& pblock, const CBlockIndex* pindex) LOCKS_EXCLUDED(cs_mapdstx); static void BlockDisconnected(const std::shared_ptr& pblock, const CBlockIndex*) LOCKS_EXCLUDED(cs_mapdstx); }; diff --git a/src/dsnotificationinterface.cpp b/src/dsnotificationinterface.cpp index 627bf4d5a3..f3e427d7e2 100644 --- a/src/dsnotificationinterface.cpp +++ b/src/dsnotificationinterface.cpp @@ -94,7 +94,7 @@ void CDSNotificationInterface::TransactionRemovedFromMempool(const CTransactionR llmq_ctx->isman->TransactionRemovedFromMempool(ptx); } -void CDSNotificationInterface::BlockConnected(const std::shared_ptr& pblock, const CBlockIndex* pindex, const std::vector& vtxConflicted) +void CDSNotificationInterface::BlockConnected(const std::shared_ptr& pblock, const CBlockIndex* pindex) { // TODO: Temporarily ensure that mempool removals are notified before // connected transactions. This shouldn't matter, but the abandoned @@ -104,9 +104,9 @@ void CDSNotificationInterface::BlockConnected(const std::shared_ptrisman->BlockConnected(pblock, pindex, vtxConflicted); - llmq_ctx->clhandler->BlockConnected(pblock, pindex, vtxConflicted); - CCoinJoin::BlockConnected(pblock, pindex, vtxConflicted); + llmq_ctx->isman->BlockConnected(pblock, pindex); + llmq_ctx->clhandler->BlockConnected(pblock, pindex); + CCoinJoin::BlockConnected(pblock, pindex); } void CDSNotificationInterface::BlockDisconnected(const std::shared_ptr& pblock, const CBlockIndex* pindexDisconnected) diff --git a/src/dsnotificationinterface.h b/src/dsnotificationinterface.h index 52d786c59c..36dc795f3d 100644 --- a/src/dsnotificationinterface.h +++ b/src/dsnotificationinterface.h @@ -32,7 +32,7 @@ protected: void UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload) override; void TransactionAddedToMempool(const CTransactionRef& tx, int64_t nAcceptTime) override; void TransactionRemovedFromMempool(const CTransactionRef& ptx, MemPoolRemovalReason reason) override; - void BlockConnected(const std::shared_ptr& pblock, const CBlockIndex* pindex, const std::vector& vtxConflicted) override; + void BlockConnected(const std::shared_ptr& pblock, const CBlockIndex* pindex) override; void BlockDisconnected(const std::shared_ptr& pblock, const CBlockIndex* pindexDisconnected) override; void NotifyMasternodeListChanged(bool undo, const CDeterministicMNList& oldMNList, const CDeterministicMNListDiff& diff, CConnman& connman) override; void NotifyChainLock(const CBlockIndex* pindex, const std::shared_ptr& clsig) override; diff --git a/src/index/base.cpp b/src/index/base.cpp index 6d1ed6ec37..93b37ca293 100644 --- a/src/index/base.cpp +++ b/src/index/base.cpp @@ -186,8 +186,7 @@ bool BaseIndex::Rewind(const CBlockIndex* current_tip, const CBlockIndex* new_ti return true; } -void BaseIndex::BlockConnected(const std::shared_ptr& block, const CBlockIndex* pindex, - const std::vector& txn_conflicted) +void BaseIndex::BlockConnected(const std::shared_ptr& block, const CBlockIndex* pindex) { if (!m_synced) { return; diff --git a/src/index/base.h b/src/index/base.h index 8e5107bee1..b284a5dcbf 100644 --- a/src/index/base.h +++ b/src/index/base.h @@ -71,8 +71,7 @@ private: bool Commit(); protected: - void BlockConnected(const std::shared_ptr& block, const CBlockIndex* pindex, - const std::vector& txn_conflicted) override; + void BlockConnected(const std::shared_ptr& block, const CBlockIndex* pindex) override; void ChainStateFlushed(const CBlockLocator& locator) override; diff --git a/src/init.cpp b/src/init.cpp index 46450d02a5..dba21635d7 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -112,6 +112,8 @@ #include #endif +#include + #if ENABLE_ZMQ #include #include diff --git a/src/interfaces/chain.cpp b/src/interfaces/chain.cpp index 77df7b3786..fc15d1b703 100644 --- a/src/interfaces/chain.cpp +++ b/src/interfaces/chain.cpp @@ -50,11 +50,9 @@ public: { m_notifications->TransactionRemovedFromMempool(tx, reason); } - void BlockConnected(const std::shared_ptr& block, - const CBlockIndex* index, - const std::vector& tx_conflicted) override + void BlockConnected(const std::shared_ptr& block, const CBlockIndex* index) override { - m_notifications->BlockConnected(*block, tx_conflicted, index->nHeight); + m_notifications->BlockConnected(*block, index->nHeight); } void BlockDisconnected(const std::shared_ptr& block, const CBlockIndex* index) override { diff --git a/src/interfaces/chain.h b/src/interfaces/chain.h index cf27658354..d893d0353a 100644 --- a/src/interfaces/chain.h +++ b/src/interfaces/chain.h @@ -222,7 +222,7 @@ public: virtual ~Notifications() {} virtual void TransactionAddedToMempool(const CTransactionRef& tx, int64_t nAcceptTime) {} virtual void TransactionRemovedFromMempool(const CTransactionRef& ptx, MemPoolRemovalReason reason) {} - virtual void BlockConnected(const CBlock& block, const std::vector& tx_conflicted, int height) {} + virtual void BlockConnected(const CBlock& block, int height) {} virtual void BlockDisconnected(const CBlock& block, int height) {} virtual void UpdatedBlockTip() {} virtual void ChainStateFlushed(const CBlockLocator& locator) {} diff --git a/src/interfaces/node.cpp b/src/interfaces/node.cpp index 0c4a51ff82..8f69b14ae5 100644 --- a/src/interfaces/node.cpp +++ b/src/interfaces/node.cpp @@ -48,6 +48,8 @@ #include +#include + namespace interfaces { namespace { diff --git a/src/llmq/chainlocks.cpp b/src/llmq/chainlocks.cpp index de57b010b6..b33311aeb7 100644 --- a/src/llmq/chainlocks.cpp +++ b/src/llmq/chainlocks.cpp @@ -353,7 +353,7 @@ void CChainLocksHandler::TransactionAddedToMempool(const CTransactionRef& tx, in txFirstSeenTime.emplace(tx->GetHash(), nAcceptTime); } -void CChainLocksHandler::BlockConnected(const std::shared_ptr& pblock, const CBlockIndex* pindex, const std::vector& vtxConflicted) +void CChainLocksHandler::BlockConnected(const std::shared_ptr& pblock, const CBlockIndex* pindex) { if (!m_mn_sync->IsBlockchainSynced()) { return; diff --git a/src/llmq/chainlocks.h b/src/llmq/chainlocks.h index 8678492d1f..a96dc01f22 100644 --- a/src/llmq/chainlocks.h +++ b/src/llmq/chainlocks.h @@ -94,7 +94,7 @@ public: void AcceptedBlockHeader(const CBlockIndex* pindexNew); void UpdatedBlockTip(); void TransactionAddedToMempool(const CTransactionRef& tx, int64_t nAcceptTime); - void BlockConnected(const std::shared_ptr& pblock, const CBlockIndex* pindex, const std::vector& vtxConflicted); + void BlockConnected(const std::shared_ptr& pblock, const CBlockIndex* pindex); void BlockDisconnected(const std::shared_ptr& pblock, const CBlockIndex* pindexDisconnected); void CheckActiveState(); void TrySignChainTip(); diff --git a/src/llmq/instantsend.cpp b/src/llmq/instantsend.cpp index c3681be0e4..731f132c69 100644 --- a/src/llmq/instantsend.cpp +++ b/src/llmq/instantsend.cpp @@ -1180,18 +1180,12 @@ void CInstantSendManager::TransactionRemovedFromMempool(const CTransactionRef& t RemoveConflictingLock(::SerializeHash(*islock), *islock); } -void CInstantSendManager::BlockConnected(const std::shared_ptr& pblock, const CBlockIndex* pindex, const std::vector& vtxConflicted) +void CInstantSendManager::BlockConnected(const std::shared_ptr& pblock, const CBlockIndex* pindex) { if (!IsInstantSendEnabled()) { return; } - if (!vtxConflicted.empty()) { - for (const auto& tx : vtxConflicted) { - RemoveConflictedTx(*tx); - } - } - if (m_mn_sync->IsBlockchainSynced()) { for (const auto& tx : pblock->vtx) { if (tx->IsCoinBase() || tx->vin.empty()) { diff --git a/src/llmq/instantsend.h b/src/llmq/instantsend.h index acca6ec480..d6b698c22a 100644 --- a/src/llmq/instantsend.h +++ b/src/llmq/instantsend.h @@ -320,7 +320,7 @@ public: void TransactionAddedToMempool(const CTransactionRef& tx) LOCKS_EXCLUDED(cs_pendingLocks); void TransactionRemovedFromMempool(const CTransactionRef& tx); - void BlockConnected(const std::shared_ptr& pblock, const CBlockIndex* pindex, const std::vector& vtxConflicted); + void BlockConnected(const std::shared_ptr& pblock, const CBlockIndex* pindex); void BlockDisconnected(const std::shared_ptr& pblock, const CBlockIndex* pindexDisconnected); bool AlreadyHave(const CInv& inv) const LOCKS_EXCLUDED(cs_pendingLocks); diff --git a/src/net_processing.cpp b/src/net_processing.cpp index d46f2a2b0e..c6fdaa5d09 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -1289,7 +1289,7 @@ PeerLogicValidation::PeerLogicValidation(CConnman& connman, BanMan* banman, CSch * Evict orphan txn pool entries (EraseOrphanTx) based on a newly connected * block. Also save the time of the last tip update. */ -void PeerLogicValidation::BlockConnected(const std::shared_ptr& pblock, const CBlockIndex* pindex, const std::vector& vtxConflicted) +void PeerLogicValidation::BlockConnected(const std::shared_ptr& pblock, const CBlockIndex* pindex) { { LOCK2(cs_main, g_cs_orphans); diff --git a/src/net_processing.h b/src/net_processing.h index 337be5c744..7e4b1d4e01 100644 --- a/src/net_processing.h +++ b/src/net_processing.h @@ -41,7 +41,7 @@ public: /** * Overridden from CValidationInterface. */ - void BlockConnected(const std::shared_ptr& pblock, const CBlockIndex* pindexConnected, const std::vector& vtxConflicted) override; + void BlockConnected(const std::shared_ptr& pblock, const CBlockIndex* pindexConnected) override; void BlockDisconnected(const std::shared_ptr &block, const CBlockIndex* pindex) override; /** * Overridden from CValidationInterface. diff --git a/src/test/validation_block_tests.cpp b/src/test/validation_block_tests.cpp index 098a87cf77..01be24a24a 100644 --- a/src/test/validation_block_tests.cpp +++ b/src/test/validation_block_tests.cpp @@ -50,7 +50,7 @@ struct TestSubscriber : public CValidationInterface { BOOST_CHECK_EQUAL(m_expected_tip, pindexNew->GetBlockHash()); } - void BlockConnected(const std::shared_ptr& block, const CBlockIndex* pindex, const std::vector& txnConflicted) override + void BlockConnected(const std::shared_ptr& block, const CBlockIndex* pindex) override { BOOST_CHECK_EQUAL(m_expected_tip, block->hashPrevBlock); BOOST_CHECK_EQUAL(m_expected_tip, pindex->pprev->GetBlockHash()); diff --git a/src/txmempool.cpp b/src/txmempool.cpp index 15e98b0dd9..dbe7d605ef 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -363,7 +363,6 @@ void CTxMemPool::AddTransactionsUpdated(unsigned int n) void CTxMemPool::addUnchecked(const CTxMemPoolEntry &entry, setEntries &setAncestors, bool validFeeEstimate) { - NotifyEntryAdded(entry.GetSharedTx()); // Add to memory pool without checking anything. // Used by AcceptToMemoryPool(), which DOES do // all the appropriate checks. @@ -619,10 +618,12 @@ bool CTxMemPool::removeSpentIndex(const uint256 txhash) void CTxMemPool::removeUnchecked(txiter it, MemPoolRemovalReason reason) { - CTransactionRef ptx = it->GetSharedTx(); - NotifyEntryRemoved(ptx, reason); - if (reason != MemPoolRemovalReason::BLOCK && reason != MemPoolRemovalReason::CONFLICT) { - GetMainSignals().TransactionRemovedFromMempool(ptx, reason); + if (reason != MemPoolRemovalReason::BLOCK) { + // Notify clients that a transaction has been removed from the mempool + // for any reason except being included in a block. Clients interested + // in transactions included in blocks can subscribe to the BlockConnected + // notification. + GetMainSignals().TransactionRemovedFromMempool(it->GetSharedTx(), reason); } const uint256 hash = it->GetTx().GetHash(); diff --git a/src/txmempool.h b/src/txmempool.h index 7e957fbc36..158bd47589 100644 --- a/src/txmempool.h +++ b/src/txmempool.h @@ -27,11 +27,11 @@ #include #include +#include #include #include #include #include -#include class CBLSPublicKey; @@ -742,9 +742,6 @@ public: size_t DynamicMemoryUsage() const; - boost::signals2::signal NotifyEntryAdded; - boost::signals2::signal NotifyEntryRemoved; - /** Adds a transaction to the unbroadcast set */ void AddUnbroadcastTx(const uint256& txid) { LOCK(cs); diff --git a/src/validation.cpp b/src/validation.cpp index b582088d54..b947704c9c 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -2757,35 +2757,21 @@ static int64_t nTimePostConnect = 0; struct PerBlockConnectTrace { CBlockIndex* pindex = nullptr; std::shared_ptr pblock; - std::shared_ptr> conflictedTxs; - PerBlockConnectTrace() : conflictedTxs(std::make_shared>()) {} + PerBlockConnectTrace() {} }; /** * Used to track blocks whose transactions were applied to the UTXO state as a * part of a single ActivateBestChainStep call. * - * This class also tracks transactions that are removed from the mempool as - * conflicts (per block) and can be used to pass all those transactions - * through SyncTransaction. - * - * This class assumes (and asserts) that the conflicted transactions for a given - * block are added via mempool callbacks prior to the BlockConnected() associated - * with those transactions. If any transactions are marked conflicted, it is - * assumed that an associated block will always be added. - * * This class is single-use, once you call GetBlocksConnected() you have to throw * it away and make a new one. */ class ConnectTrace { private: std::vector blocksConnected; - CTxMemPool &pool; - boost::signals2::scoped_connection m_connNotifyEntryRemoved; public: - explicit ConnectTrace(CTxMemPool &_pool) : blocksConnected(1), pool(_pool) { - m_connNotifyEntryRemoved = pool.NotifyEntryRemoved.connect(std::bind(&ConnectTrace::NotifyEntryRemoved, this, std::placeholders::_1, std::placeholders::_2)); - } + explicit ConnectTrace() : blocksConnected(1) {} void BlockConnected(CBlockIndex* pindex, std::shared_ptr pblock) { assert(!blocksConnected.back().pindex); @@ -2803,17 +2789,9 @@ public: // one waiting for the transactions from the next block. We pop // the last entry here to make sure the list we return is sane. assert(!blocksConnected.back().pindex); - assert(blocksConnected.back().conflictedTxs->empty()); blocksConnected.pop_back(); return blocksConnected; } - - void NotifyEntryRemoved(CTransactionRef txRemoved, MemPoolRemovalReason reason) { - assert(!blocksConnected.back().pindex); - if (reason == MemPoolRemovalReason::CONFLICT) { - blocksConnected.back().conflictedTxs->emplace_back(std::move(txRemoved)); - } - } }; /** @@ -3120,7 +3098,7 @@ bool CChainState::ActivateBestChain(CValidationState &state, const CChainParams& do { // We absolutely may not unlock cs_main until we've made forward progress // (with the exception of shutdown due to hardware issues, low disk space, etc). - ConnectTrace connectTrace(mempool); // Destructed before cs_main is unlocked + ConnectTrace connectTrace; // Destructed before cs_main is unlocked if (pindexMostWork == nullptr) { pindexMostWork = FindMostWorkChain(); @@ -3147,7 +3125,7 @@ bool CChainState::ActivateBestChain(CValidationState &state, const CChainParams& for (const PerBlockConnectTrace& trace : connectTrace.GetBlocksConnected()) { assert(trace.pblock && trace.pindex); - GetMainSignals().BlockConnected(trace.pblock, trace.pindex, trace.conflictedTxs); + GetMainSignals().BlockConnected(trace.pblock, trace.pindex); } } while (!m_chain.Tip() || (starting_tip && CBlockIndexWorkComparator()(m_chain.Tip(), starting_tip))); if (!blocks_connected) return true; diff --git a/src/validationinterface.cpp b/src/validationinterface.cpp index 08dd843819..8a33f76469 100644 --- a/src/validationinterface.cpp +++ b/src/validationinterface.cpp @@ -40,7 +40,7 @@ struct MainSignalsInstance { boost::signals2::signal UpdatedBlockTip; boost::signals2::signal SynchronousUpdatedBlockTip; boost::signals2::signal TransactionAddedToMempool; - boost::signals2::signal &, const CBlockIndex *pindex, const std::vector&)> BlockConnected; + boost::signals2::signal &, const CBlockIndex *pindex)> BlockConnected; boost::signals2::signal&, const CBlockIndex* pindex)> BlockDisconnected; boost::signals2::signal TransactionRemovedFromMempool; boost::signals2::signal ChainStateFlushed; @@ -100,7 +100,7 @@ void RegisterSharedValidationInterface(std::shared_ptr pwa conns.UpdatedBlockTip = g_signals.m_internals->UpdatedBlockTip.connect(std::bind(&CValidationInterface::UpdatedBlockTip, pwalletIn, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); conns.SynchronousUpdatedBlockTip = g_signals.m_internals->SynchronousUpdatedBlockTip.connect(std::bind(&CValidationInterface::SynchronousUpdatedBlockTip, pwalletIn, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); conns.TransactionAddedToMempool = g_signals.m_internals->TransactionAddedToMempool.connect(std::bind(&CValidationInterface::TransactionAddedToMempool, pwalletIn, std::placeholders::_1, std::placeholders::_2)); - conns.BlockConnected = g_signals.m_internals->BlockConnected.connect(std::bind(&CValidationInterface::BlockConnected, pwalletIn, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); + conns.BlockConnected = g_signals.m_internals->BlockConnected.connect(std::bind(&CValidationInterface::BlockConnected, pwalletIn, std::placeholders::_1, std::placeholders::_2)); conns.BlockDisconnected = g_signals.m_internals->BlockDisconnected.connect(std::bind(&CValidationInterface::BlockDisconnected, pwalletIn, std::placeholders::_1, std::placeholders::_2)); conns.NotifyTransactionLock = g_signals.m_internals->NotifyTransactionLock.connect(std::bind(&CValidationInterface::NotifyTransactionLock, pwalletIn, std::placeholders::_1, std::placeholders::_2)); conns.NotifyChainLock = g_signals.m_internals->NotifyChainLock.connect(std::bind(&CValidationInterface::NotifyChainLock, pwalletIn, std::placeholders::_1, std::placeholders::_2)); @@ -180,9 +180,9 @@ void CMainSignals::TransactionRemovedFromMempool(const CTransactionRef &ptx, Mem }); } -void CMainSignals::BlockConnected(const std::shared_ptr &pblock, const CBlockIndex *pindex, const std::shared_ptr>& pvtxConflicted) { - m_internals->m_schedulerClient.AddToProcessQueue([pblock, pindex, pvtxConflicted, this] { - m_internals->BlockConnected(pblock, pindex, *pvtxConflicted); +void CMainSignals::BlockConnected(const std::shared_ptr &pblock, const CBlockIndex *pindex) { + m_internals->m_schedulerClient.AddToProcessQueue([pblock, pindex, this] { + m_internals->BlockConnected(pblock, pindex); }); } diff --git a/src/validationinterface.h b/src/validationinterface.h index 4065df08f6..0790d846f1 100644 --- a/src/validationinterface.h +++ b/src/validationinterface.h @@ -117,10 +117,31 @@ protected: /** * Notifies listeners of a transaction leaving mempool. * - * This only fires for transactions which leave mempool because of expiry, - * size limiting, reorg (changes in lock times/coinbase maturity), or - * replacement. This does not include any transactions which are included - * in BlockConnectedDisconnected either in block->vtx or in txnConflicted. + * This notification fires for transactions that are removed from the + * mempool for the following reasons: + * + * - EXPIRY (expired from mempool after -mempoolexpiry hours) + * - SIZELIMIT (removed in size limiting if the mempool exceeds -maxmempool megabytes) + * - REORG (removed during a reorg) + * - CONFLICT (removed because it conflicts with in-block transaction) + * + * This does not fire for transactions that are removed from the mempool + * because they have been included in a block. Any client that is interested + * in transactions removed from the mempool for inclusion in a block can learn + * about those transactions from the BlockConnected notification. + * + * Transactions that are removed from the mempool because they conflict + * with a transaction in the new block will have + * TransactionRemovedFromMempool events fired *before* the BlockConnected + * event is fired. If multiple blocks are connected in one step, then the + * ordering could be: + * + * - TransactionRemovedFromMempool(tx1 from block A) + * - TransactionRemovedFromMempool(tx2 from block A) + * - TransactionRemovedFromMempool(tx1 from block B) + * - TransactionRemovedFromMempool(tx2 from block B) + * - BlockConnected(A) + * - BlockConnected(B) * * Called on a background thread. */ @@ -131,7 +152,7 @@ protected: * * Called on a background thread. */ - virtual void BlockConnected(const std::shared_ptr &block, const CBlockIndex *pindex, const std::vector &txnConflicted) {} + virtual void BlockConnected(const std::shared_ptr &block, const CBlockIndex *pindex) {} /** * Notifies listeners of a block being disconnected * @@ -205,7 +226,7 @@ public: void SynchronousUpdatedBlockTip(const CBlockIndex *, const CBlockIndex *, bool fInitialDownload); void TransactionAddedToMempool(const CTransactionRef &, int64_t); void TransactionRemovedFromMempool(const CTransactionRef &, MemPoolRemovalReason); - void BlockConnected(const std::shared_ptr &, const CBlockIndex *pindex, const std::shared_ptr> &); + void BlockConnected(const std::shared_ptr &, const CBlockIndex *pindex); void BlockDisconnected(const std::shared_ptr &, const CBlockIndex* pindex); void NotifyTransactionLock(const CTransactionRef &tx, const std::shared_ptr& islock); void NotifyChainLock(const CBlockIndex* pindex, const std::shared_ptr& clsig); diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 7c188d38cf..984ef87e81 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -1209,7 +1209,7 @@ void CWallet::TransactionRemovedFromMempool(const CTransactionRef &ptx, MemPoolR } } -void CWallet::BlockConnected(const CBlock& block, const std::vector& vtxConflicted, int height) +void CWallet::BlockConnected(const CBlock& block, int height) { const uint256& block_hash = block.GetHash(); LOCK(cs_wallet); @@ -1221,9 +1221,6 @@ void CWallet::BlockConnected(const CBlock& block, const std::vector& vtxConflicted, int height) override; + void BlockConnected(const CBlock& block, int height) override; void BlockDisconnected(const CBlock& block, int height) override; void UpdatedBlockTip() override; int64_t RescanFromTime(int64_t startTime, const WalletRescanReserver& reserver, bool update); diff --git a/src/zmq/zmqnotificationinterface.cpp b/src/zmq/zmqnotificationinterface.cpp index 6578fb9fb5..6245b718ce 100644 --- a/src/zmq/zmqnotificationinterface.cpp +++ b/src/zmq/zmqnotificationinterface.cpp @@ -170,7 +170,7 @@ void CZMQNotificationInterface::TransactionAddedToMempool(const CTransactionRef& }); } -void CZMQNotificationInterface::BlockConnected(const std::shared_ptr& pblock, const CBlockIndex* pindexConnected, const std::vector& vtxConflicted) +void CZMQNotificationInterface::BlockConnected(const std::shared_ptr& pblock, const CBlockIndex* pindexConnected) { for (const CTransactionRef& ptx : pblock->vtx) { // Do a normal notify for each transaction added in the block diff --git a/src/zmq/zmqnotificationinterface.h b/src/zmq/zmqnotificationinterface.h index 935ac9992c..508b7fdb8b 100644 --- a/src/zmq/zmqnotificationinterface.h +++ b/src/zmq/zmqnotificationinterface.h @@ -27,7 +27,7 @@ protected: // CValidationInterface void TransactionAddedToMempool(const CTransactionRef& tx, int64_t nAcceptTime) override; - void BlockConnected(const std::shared_ptr& pblock, const CBlockIndex* pindexConnected, const std::vector& vtxConflicted) override; + void BlockConnected(const std::shared_ptr& pblock, const CBlockIndex* pindexConnected) override; void BlockDisconnected(const std::shared_ptr& pblock, const CBlockIndex* pindexDisconnected) override; void UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload) override; void NotifyChainLock(const CBlockIndex *pindex, const std::shared_ptr& clsig) override; diff --git a/test/lint/lint-includes.sh b/test/lint/lint-includes.sh index 166431363d..87a7cff4f9 100755 --- a/test/lint/lint-includes.sh +++ b/test/lint/lint-includes.sh @@ -59,6 +59,7 @@ EXPECTED_BOOST_INCLUDES=( boost/multi_index/ordered_index.hpp boost/multi_index/sequenced_index.hpp boost/multi_index_container.hpp + boost/optional.hpp boost/pool/pool_alloc.hpp boost/preprocessor/cat.hpp boost/preprocessor/stringize.hpp