diff options
author | Pieter Wuille <pieter@wuille.net> | 2022-04-04 13:52:06 -0400 |
---|---|---|
committer | MacroFake <falke.marco@gmail.com> | 2022-04-27 14:12:55 +0200 |
commit | 78f3ac51b7d073d12da6a3b9b7d80d91e04ce3a7 (patch) | |
tree | 60a138e61a7281fbba6391da8d0d73bd0c1f9fee /src/psbt.cpp | |
parent | a65931e3ce66d87b8f83d67ecdbb46f137e6a670 (diff) | |
download | bitcoin-78f3ac51b7d073d12da6a3b9b7d80d91e04ce3a7.tar.xz |
Make DecodeBase{32,64} return optional instead of taking bool*
Diffstat (limited to 'src/psbt.cpp')
-rw-r--r-- | src/psbt.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/psbt.cpp b/src/psbt.cpp index 9b8f909349..6465e353be 100644 --- a/src/psbt.cpp +++ b/src/psbt.cpp @@ -388,13 +388,12 @@ std::string PSBTRoleName(PSBTRole role) { bool DecodeBase64PSBT(PartiallySignedTransaction& psbt, const std::string& base64_tx, std::string& error) { - bool invalid; - auto tx_data = DecodeBase64(base64_tx, &invalid); - if (invalid) { + auto tx_data = DecodeBase64(base64_tx); + if (!tx_data) { error = "invalid base64"; return false; } - return DecodeRawPSBT(psbt, MakeByteSpan(tx_data), error); + return DecodeRawPSBT(psbt, MakeByteSpan(*tx_data), error); } bool DecodeRawPSBT(PartiallySignedTransaction& psbt, Span<const std::byte> tx_data, std::string& error) |