@ -1285,7 +1285,8 @@ UniValue addwitnessaddress(const JSONRPCRequest& request)
@@ -1285,7 +1285,8 @@ UniValue addwitnessaddress(const JSONRPCRequest& request)
if ( request . fHelp | | request . params . size ( ) < 1 | | request . params . size ( ) > 2 )
{
std : : string msg = " addwitnessaddress \" address \" ( p2sh ) \n "
" \n Add a witness address for a script (with pubkey or redeemscript known). Requires a new wallet backup. \n "
" \n DEPRECATED: set the address_type argument of getnewaddress, or option -addresstype=[bech32|p2sh-segwit] instead. \n "
" Add a witness address for a script (with pubkey or redeemscript known). Requires a new wallet backup. \n "
" It returns the witness script. \n "
" \n Arguments: \n "
@ -1299,6 +1300,12 @@ UniValue addwitnessaddress(const JSONRPCRequest& request)
@@ -1299,6 +1300,12 @@ UniValue addwitnessaddress(const JSONRPCRequest& request)
throw std : : runtime_error ( msg ) ;
}
if ( ! IsDeprecatedRPCEnabled ( " addwitnessaddress " ) ) {
throw JSONRPCError ( RPC_METHOD_DEPRECATED , " addwitnessaddress is deprecated and will be fully removed in v0.17. "
" To use addwitnessaddress in v0.16, restart bitcoind with -deprecatedrpc=addwitnessaddress. \n "
" Projects should transition to using the address_type argument of getnewaddress, or option -addresstype=[bech32|p2sh-segwit] instead. \n " ) ;
}
{
LOCK ( cs_main ) ;
if ( ! IsWitnessEnabled ( chainActive . Tip ( ) , Params ( ) . GetConsensus ( ) ) & & ! gArgs . GetBoolArg ( " -walletprematurewitness " , false ) ) {
@ -3479,7 +3486,7 @@ static const CRPCCommand commands[] =
@@ -3479,7 +3486,7 @@ static const CRPCCommand commands[] =
{ " wallet " , " abandontransaction " , & abandontransaction , { " txid " } } ,
{ " wallet " , " abortrescan " , & abortrescan , { } } ,
{ " wallet " , " addmultisigaddress " , & addmultisigaddress , { " nrequired " , " keys " , " account " } } ,
{ " wallet " , " addwitnessaddress " , & addwitnessaddress , { " address " , " p2sh " } } ,
{ " hidden " , " addwitnessaddress " , & addwitnessaddress , { " address " , " p2sh " } } ,
{ " wallet " , " backupwallet " , & backupwallet , { " destination " } } ,
{ " wallet " , " bumpfee " , & bumpfee , { " txid " , " options " } } ,
{ " wallet " , " dumpprivkey " , & dumpprivkey , { " address " } } ,