Skip to content

Commit 9f5f762

Browse files
committed
wallet/gui: add silent-payments to address type dropdown
1 parent b6a7e51 commit 9f5f762

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

src/interfaces/wallet.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,9 @@ class Wallet
265265
// Return whether the wallet contains a Taproot scriptPubKeyMan
266266
virtual bool taprootEnabled() = 0;
267267

268+
// Return whether the wallet contains a Silent Payment scriptPubKeyMan
269+
virtual bool silentPaymentsEnabled() = 0;
270+
268271
// Return whether wallet uses an external signer.
269272
virtual bool hasExternalSigner() = 0;
270273

src/qt/receivecoinsdialog.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ void ReceiveCoinsDialog::setModel(WalletModel *_model)
9999
if (model->wallet().taprootEnabled()) {
100100
add_address_type(OutputType::BECH32M, tr("Bech32m (Taproot)"), tr("Bech32m (BIP-350) is an upgrade to Bech32, wallet support is still limited."));
101101
}
102+
if (model->wallet().silentPaymentsEnabled()) {
103+
add_address_type(OutputType::SILENT_PAYMENTS, tr("Silent Payment"), tr("A Silent Payment address (BIP-352) can safely be reused. Wallet support is still limited."));
104+
}
102105

103106
// Set the button to be enabled or disabled based on whether the wallet can give out new addresses.
104107
ui->receiveButton->setEnabled(model->wallet().canGetAddresses());

src/wallet/interfaces.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,10 @@ class WalletImpl : public Wallet
494494
auto spk_man = m_wallet->GetScriptPubKeyMan(OutputType::BECH32M, /*internal=*/false);
495495
return spk_man != nullptr;
496496
}
497+
bool silentPaymentsEnabled() override {
498+
auto spk_man = m_wallet->GetScriptPubKeyMan(OutputType::SILENT_PAYMENTS, /*internal=*/false);
499+
return spk_man != nullptr;
500+
}
497501
OutputType getDefaultAddressType() override { return m_wallet->m_default_address_type; }
498502
CAmount getDefaultMaxTxFee() override { return m_wallet->m_default_max_tx_fee; }
499503
void remove() override

0 commit comments

Comments
 (0)