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

This commit is contained in:
Pieter Wuille
2022-04-04 13:52:06 -04:00
committed by MacroFake
parent a65931e3ce
commit 78f3ac51b7
11 changed files with 57 additions and 77 deletions

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(),