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.
This commit is contained in:
Andrew Chow
2021-06-04 20:31:04 -04:00
parent 346e52afd6
commit fbf485c9b2
4 changed files with 45 additions and 2 deletions

View File

@@ -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