aboutsummaryrefslogtreecommitdiff
path: root/src/core_io.h
diff options
context:
space:
mode:
authorGlenn Willen <gwillen@nerdnet.org>2019-01-29 21:32:38 -0800
committerGlenn Willen <gwillen@nerdnet.org>2019-02-11 12:23:14 -0800
commitc734aaa15d924470cec0f17b00ad2e47472b471f (patch)
tree57a374ce9179e44ba453c2d48014b5375268f965 /src/core_io.h
parent162ffefd2f562169725559906601c25c579aa91c (diff)
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.
Diffstat (limited to 'src/core_io.h')
-rw-r--r--src/core_io.h6
1 files changed, 5 insertions, 1 deletions
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<unsigned char> 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