From 675fa22776a46a5bcf449f8e5ccef4d6df5ba47d Mon Sep 17 00:00:00 2001 From: lateminer <9951982+lateminer@users.noreply.github.com> Date: Sat, 14 Sep 2024 23:09:13 +0200 Subject: [PATCH] wallet: Phase out `P2SH_SEGWIT` addresses https://github.com/peercoin/peercoin/commit/9e54472c5b850fd2219fe9a4e6c6a2c8b551ae3e --- src/qt/receivecoinsdialog.cpp | 1 - src/wallet/rpc/addresses.cpp | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qt/receivecoinsdialog.cpp b/src/qt/receivecoinsdialog.cpp index 97d58dd6b4..bedbfd9266 100644 --- a/src/qt/receivecoinsdialog.cpp +++ b/src/qt/receivecoinsdialog.cpp @@ -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.")); diff --git a/src/wallet/rpc/addresses.cpp b/src/wallet/rpc/addresses.cpp index e617663f97..daf4c4f3f8 100644 --- a/src/wallet/rpc/addresses.cpp +++ b/src/wallet/rpc/addresses.cpp @@ -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(); }