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.
This commit is contained in:
Pieter Wuille authored and MacroFake committed 2022-04-27 14:12:55 +02:00
1 parent a4377a0843
commit a65931e3ce
13 files changed
+31 -30

No files matched your search

+3 -3
View File
@@ -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;
}