Skip to content

Commit

Permalink
wallet: Phase out P2SH_SEGWIT addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
lateminer committed Sep 14, 2024
1 parent 1e7881c commit 675fa22
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/qt/receivecoinsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ void ReceiveCoinsDialog::setModel(WalletModel *_model)

// Blackcoin: hide SegWit address types before SegWit activation
if (!(model->wallet().getDefaultAddressType() == OutputType::LEGACY)) {
add_address_type(OutputType::P2SH_SEGWIT, tr("Base58 (P2SH-SegWit)"), tr("Generates an address compatible with older wallets."));
add_address_type(OutputType::BECH32, tr("Bech32 (SegWit)"), tr("Generates a native segwit address (BIP-173). Some old wallets don't support it."));
if (model->wallet().taprootEnabled()) {
add_address_type(OutputType::BECH32M, tr("Bech32m (Taproot)"), tr("Bech32m (BIP-350) is an upgrade to Bech32, wallet support is still limited."));
Expand Down
2 changes: 2 additions & 0 deletions src/wallet/rpc/addresses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ RPCHelpMan getnewaddress()
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, strprintf("Unknown address type '%s'", request.params[1].get_str()));
} else if (parsed.value() == OutputType::BECH32M && pwallet->GetLegacyScriptPubKeyMan()) {
throw JSONRPCError(RPC_INVALID_PARAMETER, "Legacy wallets cannot provide bech32m addresses");
} else if (parsed.value() == OutputType::P2SH_SEGWIT) {
throw JSONRPCError(RPC_INVALID_PARAMETER, "P2SH_SEGWIT addresses are not welcome");
}
output_type = parsed.value();
}
Expand Down

0 comments on commit 675fa22

Please sign in to comment.