From 7e88f61b285e6a356ea4f6ba384858f109559985 Mon Sep 17 00:00:00 2001 From: Russell Yanofsky Date: Mon, 14 Jun 2021 17:06:00 -0400 Subject: multiprocess: Make interfaces::Chain::isTaprootActive non-const interfaces::Chain is an abstract class, so declaring the method const would be exposing internal implementation details of subclasses to interface callers. And specifically this doesn't work because the multiprocess implementation of the interfaces::Chain::isTaprootActive method can't be const because IPC connection state and request state is not constant during the call. --- src/interfaces/chain.h | 2 +- src/node/interfaces.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/interfaces/chain.h b/src/interfaces/chain.h index eceede3c8f..a134174078 100644 --- a/src/interfaces/chain.h +++ b/src/interfaces/chain.h @@ -289,7 +289,7 @@ public: virtual void requestMempoolTransactions(Notifications& notifications) = 0; //! Check if Taproot has activated - virtual bool isTaprootActive() const = 0; + virtual bool isTaprootActive() = 0; }; //! Interface to let node manage chain clients (wallets, or maybe tools for diff --git a/src/node/interfaces.cpp b/src/node/interfaces.cpp index c62d7e5d0b..b6778ed4cc 100644 --- a/src/node/interfaces.cpp +++ b/src/node/interfaces.cpp @@ -698,7 +698,7 @@ public: notifications.transactionAddedToMempool(entry.GetSharedTx(), 0 /* mempool_sequence */); } } - bool isTaprootActive() const override + bool isTaprootActive() override { LOCK(::cs_main); const CBlockIndex* tip = Assert(m_node.chainman)->ActiveChain().Tip(); -- cgit v1.2.3