Skip to content

Commit 01e275b

Browse files
committed
wallet/gui: add silent-payments to address type dropdown
1 parent 654d582 commit 01e275b

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
@@ -268,6 +268,9 @@ class Wallet
268268
// Return whether the wallet contains a Taproot scriptPubKeyMan
269269
virtual bool taprootEnabled() = 0;
270270

271+
// Return whether the wallet contains a Silent Payment scriptPubKeyMan
272+
virtual bool silentPaymentsEnabled() = 0;
273+
271274
// Return whether wallet uses an external signer.
272275
virtual bool hasExternalSigner() = 0;
273276

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
@@ -503,6 +503,10 @@ class WalletImpl : public Wallet
503503
auto spk_man = m_wallet->GetScriptPubKeyMan(OutputType::BECH32M, /*internal=*/false);
504504
return spk_man != nullptr;
505505
}
506+
bool silentPaymentsEnabled() override {
507+
auto spk_man = m_wallet->GetScriptPubKeyMan(OutputType::SILENT_PAYMENTS, /*internal=*/false);
508+
return spk_man != nullptr;
509+
}
506510
OutputType getDefaultAddressType() override { return m_wallet->m_default_address_type; }
507511
CAmount getDefaultMaxTxFee() override { return m_wallet->m_default_max_tx_fee; }
508512
void remove() override

0 commit comments

Comments
 (0)