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/qt | |
parent | a4377a0843636eae0aaf698510fc6518582545db (diff) |
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/qt')
-rw-r--r-- | src/qt/walletframe.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/qt/walletframe.cpp b/src/qt/walletframe.cpp index 91ce420a33..663e86aa29 100644 --- a/src/qt/walletframe.cpp +++ b/src/qt/walletframe.cpp @@ -194,7 +194,7 @@ void WalletFrame::gotoVerifyMessageTab(QString addr) void WalletFrame::gotoLoadPSBT(bool from_clipboard) { - std::string data; + std::vector<unsigned char> data; if (from_clipboard) { std::string raw = QApplication::clipboard()->text().toStdString(); @@ -214,12 +214,12 @@ void WalletFrame::gotoLoadPSBT(bool from_clipboard) return; } std::ifstream in{filename.toLocal8Bit().data(), std::ios::binary}; - data = std::string(std::istreambuf_iterator<char>{in}, {}); + data.assign(std::istream_iterator<unsigned char>{in}, {}); } std::string error; PartiallySignedTransaction psbtx; - if (!DecodeRawPSBT(psbtx, data, error)) { + if (!DecodeRawPSBT(psbtx, MakeByteSpan(data), error)) { Q_EMIT message(tr("Error"), tr("Unable to decode PSBT") + "\n" + QString::fromStdString(error), CClientUIInterface::MSG_ERROR); return; } |