aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet.h
diff options
context:
space:
mode:
authorAndrew Chow <achow101-github@achow101.com>2020-02-10 19:50:56 -0500
committerAndrew Chow <achow101-github@achow101.com>2020-03-09 11:16:17 -0400
commit3d70dd99f9f74eef70b19ff6f6f850adc0d5ef8f (patch)
tree4a4f77dfab8fa0209237a259293ccc545c2f5037 /src/wallet/wallet.h
parenta4af324d15c1ee43c2abd11a304ae18c7ee82eb0 (diff)
downloadbitcoin-3d70dd99f9f74eef70b19ff6f6f850adc0d5ef8f.tar.xz
Move FillPSBT to be a member of CWallet
Diffstat (limited to 'src/wallet/wallet.h')
-rw-r--r--src/wallet/wallet.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h
index 10380e4e58..15353de4ac 100644
--- a/src/wallet/wallet.h
+++ b/src/wallet/wallet.h
@@ -11,6 +11,7 @@
#include <interfaces/handler.h>
#include <outputtype.h>
#include <policy/feerate.h>
+#include <psbt.h>
#include <tinyformat.h>
#include <ui_interface.h>
#include <util/strencodings.h>
@@ -922,6 +923,25 @@ public:
bool SignTransaction(CMutableTransaction& tx, const std::map<COutPoint, Coin>& coins, int sighash, std::map<int, std::string>& input_errors) const;
/**
+ * 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,
+ int sighash_type = 1 /* SIGHASH_ALL */,
+ bool sign = true,
+ bool bip32derivs = true) const;
+
+ /**
* Create a new transaction paying the recipients with a set of coins
* selected by SelectCoins(); Also create the change output, when needed
* @note passing nChangePosInOut as -1 will result in setting a random position