diff options
author | Andrew Chow <achow101-github@achow101.com> | 2021-06-04 20:31:04 -0400 |
---|---|---|
committer | Andrew Chow <achow101-github@achow101.com> | 2021-06-10 15:45:47 -0400 |
commit | fbf485c9b2bf1d056bfea77345a15cf56a9cd786 (patch) | |
tree | 3b4e510a4e0bfa9871eec7548a2505c70dc7065c /src/node/interfaces.cpp | |
parent | 346e52afd6d5e317c96fc506bb54cde13e87c8b2 (diff) | |
download | bitcoin-fbf485c9b2bf1d056bfea77345a15cf56a9cd786.tar.xz |
Allow tr() import only when Taproot is active
To avoid issues around fund loss, only allow descriptor wallets
to import tr() descriptors after taproot has activated.
Diffstat (limited to 'src/node/interfaces.cpp')
-rw-r--r-- | src/node/interfaces.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/node/interfaces.cpp b/src/node/interfaces.cpp index 8befbf5e30..e88594f7d6 100644 --- a/src/node/interfaces.cpp +++ b/src/node/interfaces.cpp @@ -709,6 +709,12 @@ public: notifications.transactionAddedToMempool(entry.GetSharedTx(), 0 /* mempool_sequence */); } } + bool isTaprootActive() const override + { + LOCK(::cs_main); + const CBlockIndex* tip = Assert(m_node.chainman)->ActiveChain().Tip(); + return VersionBitsState(tip, Params().GetConsensus(), Consensus::DEPLOYMENT_TAPROOT, versionbitscache) == ThresholdState::ACTIVE; + } NodeContext& m_node; }; } // namespace |