From c734aaa15d924470cec0f17b00ad2e47472b471f Mon Sep 17 00:00:00 2001 From: Glenn Willen Date: Tue, 29 Jan 2019 21:32:38 -0800 Subject: Split DecodePSBT into Base64 and Raw versions Split up DecodePSBT, which both decodes base64 and then deserializes a PartiallySignedTransaction, into two functions: DecodeBase64PSBT, which retains the old behavior, and DecodeRawPSBT, which only performs the deserialization. Add a test for base64 decoding failure. --- src/core_io.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/core_io.h') diff --git a/src/core_io.h b/src/core_io.h index 6f87161f46..ae377eb6e8 100644 --- a/src/core_io.h +++ b/src/core_io.h @@ -37,7 +37,11 @@ bool DecodeHexBlockHeader(CBlockHeader&, const std::string& hex_header); */ bool ParseHashStr(const std::string& strHex, uint256& result); std::vector ParseHexUV(const UniValue& v, const std::string& strName); -NODISCARD bool DecodePSBT(PartiallySignedTransaction& psbt, const std::string& base64_tx, std::string& error); + +//! 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 +NODISCARD bool DecodeRawPSBT(PartiallySignedTransaction& decoded_psbt, const std::string& raw_psbt, std::string& error); int ParseSighashString(const UniValue& sighash); // core_write.cpp -- cgit v1.2.3