Skip to content

Commit

Permalink
qt: Load PSBTs using istreambuf_iterator rather than istream_iterator
Browse files Browse the repository at this point in the history
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: bb5ea1d
  • Loading branch information
achow101 authored and MarcoFalke committed Dec 21, 2022
1 parent b3f866a commit 0662105
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/qt/walletframe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()};
Expand Down

0 comments on commit 0662105

Please sign in to comment.