diff options
author | Pieter Wuille <pieter@wuille.net> | 2022-04-04 13:19:49 -0400 |
---|---|---|
committer | MacroFake <falke.marco@gmail.com> | 2022-04-27 14:12:55 +0200 |
commit | a65931e3ce66d87b8f83d67ecdbb46f137e6a670 (patch) | |
tree | 1cdbaa2a15af7b87d7a963c4c759c2a29ddbe437 /src/psbt.cpp | |
parent | a4377a0843636eae0aaf698510fc6518582545db (diff) | |
download | bitcoin-a65931e3ce66d87b8f83d67ecdbb46f137e6a670.tar.xz |
Make DecodeBase{32,64} always return vector, not string
Base32/base64 are mechanisms for encoding binary data. That they'd
decode to a string is just bizarre. The fact that they'd do that
based on the type of input arguments even more so.
Diffstat (limited to 'src/psbt.cpp')
-rw-r--r-- | src/psbt.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/psbt.cpp b/src/psbt.cpp index c8c73e130b..9b8f909349 100644 --- a/src/psbt.cpp +++ b/src/psbt.cpp @@ -389,17 +389,17 @@ std::string PSBTRoleName(PSBTRole role) { bool DecodeBase64PSBT(PartiallySignedTransaction& psbt, const std::string& base64_tx, std::string& error) { bool invalid; - std::string tx_data = DecodeBase64(base64_tx, &invalid); + auto tx_data = DecodeBase64(base64_tx, &invalid); if (invalid) { error = "invalid base64"; return false; } - return DecodeRawPSBT(psbt, tx_data, error); + return DecodeRawPSBT(psbt, MakeByteSpan(tx_data), error); } -bool DecodeRawPSBT(PartiallySignedTransaction& psbt, const std::string& tx_data, std::string& error) +bool DecodeRawPSBT(PartiallySignedTransaction& psbt, Span<const std::byte> tx_data, std::string& error) { - CDataStream ss_data(MakeByteSpan(tx_data), SER_NETWORK, PROTOCOL_VERSION); + CDataStream ss_data(tx_data, SER_NETWORK, PROTOCOL_VERSION); try { ss_data >> psbt; if (!ss_data.empty()) { |