Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.h
// Copyright (c) 2009-2010 Satoshi Nakamoto | // Copyright (c) 2009-2010 Satoshi Nakamoto | ||||
// Copyright (c) 2009-2016 The Bitcoin Core developers | // Copyright (c) 2009-2016 The Bitcoin Core developers | ||||
// Copyright (c) 2018-2020 The Bitcoin developers | // Copyright (c) 2018-2020 The Bitcoin developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#ifndef BITCOIN_WALLET_WALLET_H | #ifndef BITCOIN_WALLET_WALLET_H | ||||
#define BITCOIN_WALLET_WALLET_H | #define BITCOIN_WALLET_WALLET_H | ||||
#include <amount.h> | #include <amount.h> | ||||
#include <interfaces/chain.h> | #include <interfaces/chain.h> | ||||
#include <interfaces/handler.h> | #include <interfaces/handler.h> | ||||
#include <outputtype.h> | #include <outputtype.h> | ||||
#include <primitives/blockhash.h> | #include <primitives/blockhash.h> | ||||
#include <psbt.h> | |||||
#include <tinyformat.h> | #include <tinyformat.h> | ||||
#include <ui_interface.h> | #include <ui_interface.h> | ||||
#include <util/strencodings.h> | #include <util/strencodings.h> | ||||
#include <util/system.h> | #include <util/system.h> | ||||
#include <util/translation.h> | #include <util/translation.h> | ||||
#include <validationinterface.h> | #include <validationinterface.h> | ||||
#include <wallet/coinselection.h> | #include <wallet/coinselection.h> | ||||
#include <wallet/crypter.h> | #include <wallet/crypter.h> | ||||
▲ Show 20 Lines • Show All 1,073 Lines • ▼ Show 20 Lines | bool FundTransaction(CMutableTransaction &tx, Amount &nFeeRet, | ||||
int &nChangePosInOut, bilingual_str &error, | int &nChangePosInOut, bilingual_str &error, | ||||
bool lockUnspents, | bool lockUnspents, | ||||
const std::set<int> &setSubtractFeeFromOutputs, | const std::set<int> &setSubtractFeeFromOutputs, | ||||
CCoinControl coinControl); | CCoinControl coinControl); | ||||
bool SignTransaction(CMutableTransaction &tx) | bool SignTransaction(CMutableTransaction &tx) | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | ||||
/** | /** | ||||
* Fills out a PSBT with information from the wallet. Fills in UTXOs if we | |||||
* have them. Tries to sign if sign=true. Sets `complete` if the PSBT is now | |||||
* complete (i.e. has all required signatures or signature-parts, and is | |||||
* ready to finalize.) Sets `error` and returns false if something goes | |||||
* wrong. | |||||
* | |||||
* @param[in] psbtx PartiallySignedTransaction to fill in | |||||
* @param[out] complete indicates whether the PSBT is now complete | |||||
* @param[in] sighash_type the sighash type to use when signing (if PSBT | |||||
* does not specify) | |||||
* @param[in] sign whether to sign or not | |||||
* @param[in] bip32derivs whether to fill in bip32 derivation information | |||||
* if available return error | |||||
*/ | |||||
TransactionError | |||||
FillPSBT(PartiallySignedTransaction &psbtx, bool &complete, | |||||
SigHashType sighash_type = SigHashType().withForkId(), | |||||
bool sign = true, bool bip32derivs = true) const; | |||||
PiRK: Wouldn't it be better to do the change for the default value of `bip32derivs` to `true` in a… | |||||
deadalnixAuthorUnsubmitted Done Inline ActionsLet's add it to the queue, we can move forward here anyways. deadalnix: Let's add it to the queue, we can move forward here anyways. | |||||
/** | |||||
* Create a new transaction paying the recipients with a set of coins | * Create a new transaction paying the recipients with a set of coins | ||||
* selected by SelectCoins(); Also create the change output, when needed | * selected by SelectCoins(); Also create the change output, when needed | ||||
* @note passing nChangePosInOut as -1 will result in setting a random | * @note passing nChangePosInOut as -1 will result in setting a random | ||||
* position | * position | ||||
*/ | */ | ||||
bool CreateTransaction(const std::vector<CRecipient> &vecSend, | bool CreateTransaction(const std::vector<CRecipient> &vecSend, | ||||
CTransactionRef &tx, Amount &nFeeRet, | CTransactionRef &tx, Amount &nFeeRet, | ||||
int &nChangePosInOut, bilingual_str &error, | int &nChangePosInOut, bilingual_str &error, | ||||
▲ Show 20 Lines • Show All 412 Lines • Show Last 20 Lines |
Wouldn't it be better to do the change for the default value of bip32derivs to true in a separate diff? There seem to be some additional changes related to this change (tests, documentation), when I look at PR17264