mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-06 05:37:50 +02:00
Remove confusing OutputType::CHANGE_AUTO
This commit is contained in:
@@ -306,7 +306,7 @@ static UniValue getrawchangeaddress(const JSONRPCRequest& request)
|
||||
throw JSONRPCError(RPC_WALLET_ERROR, "Error: This wallet has no available keys");
|
||||
}
|
||||
|
||||
OutputType output_type = pwallet->m_default_change_type != OutputType::CHANGE_AUTO ? pwallet->m_default_change_type : pwallet->m_default_address_type;
|
||||
OutputType output_type = pwallet->m_default_change_type.get_value_or(pwallet->m_default_address_type);
|
||||
if (!request.params[0].isNull()) {
|
||||
if (!ParseOutputType(request.params[0].get_str(), output_type)) {
|
||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, strprintf("Unknown address type '%s'", request.params[0].get_str()));
|
||||
@@ -2993,10 +2993,11 @@ void FundTransaction(CWallet* const pwallet, CMutableTransaction& tx, CAmount& f
|
||||
if (options.exists("changeAddress")) {
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Cannot specify both changeAddress and address_type options");
|
||||
}
|
||||
coinControl.m_change_type = pwallet->m_default_change_type;
|
||||
if (!ParseOutputType(options["change_type"].get_str(), *coinControl.m_change_type)) {
|
||||
OutputType out_type;
|
||||
if (!ParseOutputType(options["change_type"].get_str(), out_type)) {
|
||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, strprintf("Unknown change type '%s'", options["change_type"].get_str()));
|
||||
}
|
||||
coinControl.m_change_type.emplace(out_type);
|
||||
}
|
||||
|
||||
coinControl.fAllowWatchOnly = ParseIncludeWatchonly(options["includeWatching"], *pwallet);
|
||||
|
||||
Reference in New Issue
Block a user