From 4d074e84a2cf419510e2920417799f62747f4b07 Mon Sep 17 00:00:00 2001 From: Russell Yanofsky Date: Mon, 8 Apr 2019 16:33:05 -0400 Subject: [build] Move AnalyzePSBT from psbt.cpp to node/psbt.cpp psbt.cpp definitions except for AnalyzePSBT are used by the wallet and need to be linked into the wallet binary. AnalyzePSBT is an exception in that it is not used by the wallet, and depends on node classes like CCoinsViewCache, and on node global variables like nBytesPerSigOp. So AnalyzePSBT is more at home in libbitcoin_server than libbitcoin_common, and in any case needs to be defined in a separate object file than other PSBT utilities, to avoid dragging link dependencies on node functions and global variables into the wallet. --- src/psbt.h | 33 --------------------------------- 1 file changed, 33 deletions(-) (limited to 'src/psbt.h') diff --git a/src/psbt.h b/src/psbt.h index fcb3337a53..1bc1e91a84 100644 --- a/src/psbt.h +++ b/src/psbt.h @@ -557,31 +557,6 @@ enum class PSBTRole { EXTRACTOR }; -/** - * Holds an analysis of one input from a PSBT - */ -struct PSBTInputAnalysis { - bool has_utxo; //!< Whether we have UTXO information for this input - bool is_final; //!< Whether the input has all required information including signatures - PSBTRole next; //!< Which of the BIP 174 roles needs to handle this input next - - std::vector missing_pubkeys; //!< Pubkeys whose BIP32 derivation path is missing - std::vector missing_sigs; //!< Pubkeys whose signatures are missing - uint160 missing_redeem_script; //!< Hash160 of redeem script, if missing - uint256 missing_witness_script; //!< SHA256 of witness script, if missing -}; - -/** - * Holds the results of AnalyzePSBT (miscellaneous information about a PSBT) - */ -struct PSBTAnalysis { - Optional estimated_vsize; //!< Estimated weight of the transaction - Optional estimated_feerate; //!< Estimated feerate (fee / weight) of the transaction - Optional fee; //!< Amount of fee being paid by the transaction - std::vector inputs; //!< More information about the individual inputs of the transaction - PSBTRole next; //!< Which of the BIP 174 roles needs to handle the transaction next -}; - std::string PSBTRoleName(PSBTRole role); /** Checks whether a PSBTInput is already signed. */ @@ -616,14 +591,6 @@ bool FinalizeAndExtractPSBT(PartiallySignedTransaction& psbtx, CMutableTransacti */ NODISCARD TransactionError CombinePSBTs(PartiallySignedTransaction& out, const std::vector& psbtxs); -/** - * Provides helpful miscellaneous information about where a PSBT is in the signing workflow. - * - * @param[in] psbtx the PSBT to analyze - * @return A PSBTAnalysis with information about the provided PSBT. - */ -PSBTAnalysis AnalyzePSBT(PartiallySignedTransaction psbtx); - //! Decode a base64ed PSBT into a PartiallySignedTransaction NODISCARD bool DecodeBase64PSBT(PartiallySignedTransaction& decoded_psbt, const std::string& base64_psbt, std::string& error); //! Decode a raw (binary blob) PSBT into a PartiallySignedTransaction -- cgit v1.2.3