Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.cpp
Show First 20 Lines • Show All 2,884 Lines • ▼ Show 20 Lines | if (IsDeprecatedRPCEnabled(gArgs, "fundrawtransaction")) { | ||||
reservekey.KeepKey(); | reservekey.KeepKey(); | ||||
} | } | ||||
} | } | ||||
return true; | return true; | ||||
} | } | ||||
OutputType | OutputType | ||||
CWallet::TransactionChangeType(const std::vector<CRecipient> &vecSend) { | CWallet::TransactionChangeType(OutputType change_type, | ||||
const std::vector<CRecipient> &vecSend) { | |||||
// If -changetype is specified, always use that change type. | // If -changetype is specified, always use that change type. | ||||
if (g_change_type != OutputType::NONE) { | if (change_type != OutputType::NONE) { | ||||
return g_change_type; | return change_type; | ||||
} | } | ||||
// if g_address_type is legacy, use legacy address as change. | // if g_address_type is legacy, use legacy address as change. | ||||
if (g_address_type == OutputType::LEGACY) { | if (g_address_type == OutputType::LEGACY) { | ||||
return OutputType::LEGACY; | return OutputType::LEGACY; | ||||
} | } | ||||
// else use g_address_type for change | // else use g_address_type for change | ||||
▲ Show 20 Lines • Show All 95 Lines • ▼ Show 20 Lines | assert(txNew.nLockTime < LOCKTIME_THRESHOLD); | ||||
bool ret; | bool ret; | ||||
ret = reservekey.GetReservedKey(vchPubKey, true); | ret = reservekey.GetReservedKey(vchPubKey, true); | ||||
if (!ret) { | if (!ret) { | ||||
strFailReason = | strFailReason = | ||||
_("Keypool ran out, please call keypoolrefill first"); | _("Keypool ran out, please call keypoolrefill first"); | ||||
return false; | return false; | ||||
} | } | ||||
const OutputType change_type = TransactionChangeType(vecSend); | const OutputType change_type = | ||||
TransactionChangeType(coinControl.change_type, vecSend); | |||||
LearnRelatedScripts(vchPubKey, change_type); | LearnRelatedScripts(vchPubKey, change_type); | ||||
scriptChange = GetScriptForDestination( | scriptChange = GetScriptForDestination( | ||||
GetDestinationForKey(vchPubKey, change_type)); | GetDestinationForKey(vchPubKey, change_type)); | ||||
} | } | ||||
CTxOut change_prototype_txout(Amount::zero(), scriptChange); | CTxOut change_prototype_txout(Amount::zero(), scriptChange); | ||||
coin_selection_params.change_output_size = | coin_selection_params.change_output_size = | ||||
GetSerializeSize(change_prototype_txout, SER_DISK, 0); | GetSerializeSize(change_prototype_txout, SER_DISK, 0); | ||||
▲ Show 20 Lines • Show All 1,753 Lines • Show Last 20 Lines |