0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-08 10:31:50 -05:00

wallet: add taprootEnabled() to interface

This commit is contained in:
Sjors Provoost 2021-10-29 14:06:21 +02:00
parent 887796a5ff
commit 56113daef4
No known key found for this signature in database
GPG key ID: 57FF9BDBCC301009
2 changed files with 8 additions and 0 deletions

View file

@ -256,6 +256,9 @@ public:
// Return whether private keys enabled.
virtual bool privateKeysDisabled() = 0;
// Return whether the wallet contains a Taproot scriptPubKeyMan
virtual bool taprootEnabled() = 0;
// Return whether wallet uses an external signer.
virtual bool hasExternalSigner() = 0;

View file

@ -461,6 +461,11 @@ public:
bool canGetAddresses() override { return m_wallet->CanGetAddresses(); }
bool hasExternalSigner() override { return m_wallet->IsWalletFlagSet(WALLET_FLAG_EXTERNAL_SIGNER); }
bool privateKeysDisabled() override { return m_wallet->IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS); }
bool taprootEnabled() override {
if (m_wallet->IsLegacy()) return false;
auto spk_man = m_wallet->GetScriptPubKeyMan(OutputType::BECH32M, /*internal=*/false);
return spk_man != nullptr;
}
OutputType getDefaultAddressType() override { return m_wallet->m_default_address_type; }
CAmount getDefaultMaxTxFee() override { return m_wallet->m_default_max_tx_fee; }
void remove() override