aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces
diff options
context:
space:
mode:
authorAntoine Riard <ariard@student.42.fr>2019-07-24 15:41:41 -0400
committerAntoine Riard <ariard@student.42.fr>2019-11-05 12:59:16 -0500
commit10b4729e33f76092bd8cfa06d1a5e0a066436f76 (patch)
tree7ef80f8890067aa49125583624db014a0d6ec1e2 /src/interfaces
parent50591f6ec61b802cf4193cdbefcc85ad75716e8d (diff)
downloadbitcoin-10b4729e33f76092bd8cfa06d1a5e0a066436f76.tar.xz
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.
Diffstat (limited to 'src/interfaces')
-rw-r--r--src/interfaces/chain.cpp6
-rw-r--r--src/interfaces/chain.h4
2 files changed, 5 insertions, 5 deletions
diff --git a/src/interfaces/chain.cpp b/src/interfaces/chain.cpp
index 23099a7799..c2a8faf8c3 100644
--- a/src/interfaces/chain.cpp
+++ b/src/interfaces/chain.cpp
@@ -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
{
diff --git a/src/interfaces/chain.h b/src/interfaces/chain.h
index 82eeba1160..4cb2aba2c9 100644
--- a/src/interfaces/chain.h
+++ b/src/interfaces/chain.h
@@ -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) {}
};