Make DecodeBase{32,64} return optional instead of taking bool*

This commit is contained in:
Pieter Wuille authored and MacroFake committed 2022-04-27 14:12:55 +02:00
1 parent a65931e3ce
commit 78f3ac51b7
11 files changed
+57 -77

No files matched your search

+3 -3
View File
@@ -198,12 +198,12 @@ void WalletFrame::gotoLoadPSBT(bool from_clipboard)
if (from_clipboard) {
std::string raw = QApplication::clipboard()->text().toStdString();
bool invalid;
data = DecodeBase64(raw, &invalid);
if (invalid) {
auto result = DecodeBase64(raw);
if (!result) {
Q_EMIT message(tr("Error"), tr("Unable to decode PSBT from clipboard (invalid base64)"), CClientUIInterface::MSG_ERROR);
return;
}
data = std::move(*result);
} else {
QString filename = GUIUtil::getOpenFileName(this,
tr("Load Transaction Data"), QString(),