mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-20 13:37:28 +02:00
Merge 6decdedaf9 into merged_master (Bitcoin PR bitcoin-core/gui#469)
This commit is contained in:
commit
8201d06e41
1 changed files with 8 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue