mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
Pass block height in Chain::BlockConnected/Chain::BlockDisconnected
To do so we update CValidationInterface::BlockDisconnect to take a CBlockIndex pointing to the block being disconnected. This new parameter will be use in the following commit to establish wallet height.
This commit is contained in:
@@ -182,11 +182,11 @@ public:
|
||||
const CBlockIndex* index,
|
||||
const std::vector<CTransactionRef>& tx_conflicted) override
|
||||
{
|
||||
m_notifications->BlockConnected(*block, tx_conflicted);
|
||||
m_notifications->BlockConnected(*block, tx_conflicted, index->nHeight);
|
||||
}
|
||||
void BlockDisconnected(const std::shared_ptr<const CBlock>& block) override
|
||||
void BlockDisconnected(const std::shared_ptr<const CBlock>& block, const CBlockIndex* index) override
|
||||
{
|
||||
m_notifications->BlockDisconnected(*block);
|
||||
m_notifications->BlockDisconnected(*block, index->nHeight);
|
||||
}
|
||||
void UpdatedBlockTip(const CBlockIndex* index, const CBlockIndex* fork_index, bool is_ibd) override
|
||||
{
|
||||
|
||||
@@ -226,8 +226,8 @@ public:
|
||||
virtual ~Notifications() {}
|
||||
virtual void TransactionAddedToMempool(const CTransactionRef& tx) {}
|
||||
virtual void TransactionRemovedFromMempool(const CTransactionRef& ptx) {}
|
||||
virtual void BlockConnected(const CBlock& block, const std::vector<CTransactionRef>& tx_conflicted) {}
|
||||
virtual void BlockDisconnected(const CBlock& block) {}
|
||||
virtual void BlockConnected(const CBlock& block, const std::vector<CTransactionRef>& tx_conflicted, int height) {}
|
||||
virtual void BlockDisconnected(const CBlock& block, int height) {}
|
||||
virtual void UpdatedBlockTip() {}
|
||||
virtual void ChainStateFlushed(const CBlockLocator& locator) {}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user