2019-02-14 16:01:06 +01:00
|
|
|
// Copyright (c) 2009-2019 The Bitcoin Core developers
|
2019-01-09 11:06:29 +01:00
|
|
|
// Distributed under the MIT software license, see the accompanying
|
|
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
|
|
|
|
#ifndef BITCOIN_WALLET_PSBTWALLET_H
|
|
|
|
#define BITCOIN_WALLET_PSBTWALLET_H
|
|
|
|
|
2019-02-10 05:51:33 +01:00
|
|
|
#include <node/transaction.h>
|
2019-01-09 11:06:29 +01:00
|
|
|
#include <psbt.h>
|
|
|
|
#include <primitives/transaction.h>
|
|
|
|
#include <wallet/wallet.h>
|
|
|
|
|
2019-02-10 05:51:33 +01:00
|
|
|
/**
|
|
|
|
* 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] pwallet pointer to a wallet
|
|
|
|
* @param[in] &psbtx reference to 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
|
2019-02-14 16:01:06 +01:00
|
|
|
* return error
|
2019-02-10 05:51:33 +01:00
|
|
|
*/
|
2019-02-14 16:01:06 +01:00
|
|
|
NODISCARD TransactionError FillPSBT(const CWallet* pwallet,
|
2019-02-10 05:51:33 +01:00
|
|
|
PartiallySignedTransaction& psbtx,
|
|
|
|
bool& complete,
|
|
|
|
int sighash_type = 1 /* SIGHASH_ALL */,
|
|
|
|
bool sign = true,
|
|
|
|
bool bip32derivs = false);
|
2019-01-09 11:06:29 +01:00
|
|
|
|
|
|
|
#endif // BITCOIN_WALLET_PSBTWALLET_H
|