From 3a126724195fcf00d84e852a9247475fccd14f38 Mon Sep 17 00:00:00 2001 From: Andrew Chow Date: Mon, 18 Jan 2021 20:38:28 -0500 Subject: GUI: Write PSBTs to file with binary mode Github-Pull: #bitcoin-core/gui#188 Rebased-From: cc3971c9ff538a924c1a76ca1352bcaeb24f579f --- src/qt/psbtoperationsdialog.cpp | 2 +- src/qt/sendcoinsdialog.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/qt') diff --git a/src/qt/psbtoperationsdialog.cpp b/src/qt/psbtoperationsdialog.cpp index 58167d4bb4..28103495da 100644 --- a/src/qt/psbtoperationsdialog.cpp +++ b/src/qt/psbtoperationsdialog.cpp @@ -145,7 +145,7 @@ void PSBTOperationsDialog::saveTransaction() { if (filename.isEmpty()) { return; } - std::ofstream out(filename.toLocal8Bit().data()); + std::ofstream out(filename.toLocal8Bit().data(), std::ofstream::out | std::ofstream::binary); out << ssTx.str(); out.close(); showStatus(tr("PSBT saved to disk."), StatusLevel::INFO); diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index 63b06b6215..62606ff0b0 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -427,7 +427,7 @@ void SendCoinsDialog::on_sendButton_clicked() if (filename.isEmpty()) { return; } - std::ofstream out(filename.toLocal8Bit().data()); + std::ofstream out(filename.toLocal8Bit().data(), std::ofstream::out | std::ofstream::binary); out << ssTx.str(); out.close(); Q_EMIT message(tr("PSBT saved"), "PSBT saved to disk", CClientUIInterface::MSG_INFORMATION); -- cgit v1.2.3