aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Chow <github@achow101.com>2022-12-18 13:20:20 -0500
committerMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2022-12-21 09:52:40 +0100
commit0662105e884dce3eae9d3eb0b0d49600c1260b90 (patch)
treea4051e7eb2c18b941fac78d5f11e90e2414901a9
parentb3f866a8dfd652b6339b79124843e58bd0bf3013 (diff)
qt: Load PSBTs using istreambuf_iterator rather than istream_iterator
istream_iterator eats whitespace charactesr which causes parsing failures for PSBTs that contain the bytes corresponding to those characters. Github-Pull: bitcoin-core/gui#687 Rebased-From: bb5ea1d9a954b7b9f443ee8fbbb04549cd0b08a7
-rw-r--r--src/qt/walletframe.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qt/walletframe.cpp b/src/qt/walletframe.cpp
index 8dc97e66a2..adc7793916 100644
--- a/src/qt/walletframe.cpp
+++ b/src/qt/walletframe.cpp
@@ -212,7 +212,7 @@ void WalletFrame::gotoLoadPSBT(bool from_clipboard)
return;
}
std::ifstream in{filename.toLocal8Bit().data(), std::ios::binary};
- data.assign(std::istream_iterator<unsigned char>{in}, {});
+ data.assign(std::istreambuf_iterator<char>{in}, {});
// Some psbt files may be base64 strings in the file rather than binary data
std::string b64_str{data.begin(), data.end()};