mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-25 15:05:55 +01:00
[wallet] use P2WPKH change output if any destination is P2WPKH or P2WSH
Only if -changetype is not set and -addresstype is not "legacy".
This commit is contained in:
@@ -643,8 +643,9 @@ void PaymentServer::fetchPaymentACK(CWallet* wallet, const SendCoinsRecipient& r
|
||||
// use for change. Despite an actual payment and not change, this is a close match:
|
||||
// it's the output type we use subject to privacy issues, but not restricted by what
|
||||
// other software supports.
|
||||
wallet->LearnRelatedScripts(newKey, g_change_type);
|
||||
CTxDestination dest = GetDestinationForKey(newKey, g_change_type);
|
||||
const OutputType change_type = g_change_type != OUTPUT_TYPE_NONE ? g_change_type : g_address_type;
|
||||
wallet->LearnRelatedScripts(newKey, change_type);
|
||||
CTxDestination dest = GetDestinationForKey(newKey, change_type);
|
||||
wallet->SetAddressBook(dest, strAccount, "refund");
|
||||
|
||||
CScript s = GetScriptForDestination(dest);
|
||||
|
||||
Reference in New Issue
Block a user