Merge 6decdedaf9 into merged_master (Bitcoin PR bitcoin-core/gui#469)

This commit is contained in:
James Dorfman 2024-10-16 07:07:39 +00:00
commit 8201d06e41

View file

@ -213,6 +213,14 @@ void WalletFrame::gotoLoadPSBT(bool from_clipboard)
}
std::ifstream in{filename.toLocal8Bit().data(), std::ios::binary};
data.assign(std::istream_iterator<unsigned char>{in}, {});
// Some psbt files may be base64 strings in the file rather than binary data
std::string b64_str{data.begin(), data.end()};
b64_str.erase(b64_str.find_last_not_of(" \t\n\r\f\v") + 1); // Trim trailing whitespace
auto b64_dec = DecodeBase64(b64_str);
if (b64_dec.has_value()) {
data = b64_dec.value();
}
}
std::string error;