Skip to content

Commit b972913

Browse files
author
MarcoFalke
committed
Merge bitcoin-core#188: Write PSBTs to file with binary mode
cc3971c GUI: Write PSBTs to file with binary mode (Andrew Chow) Pull request description: As noted in bitcoin/bitcoin#20959, PSBT files should be opened in binary mode as on windows, all newlines are turned into CRLF which produces invalid PSBTs. Fixes bitcoin/bitcoin#20959 ACKs for top commit: Talkless: utACK cc3971c. Tree-SHA512: fee62b66da844017a44d7d6da6d2d2794b097a7dec33fb07711615df1e94dccc76f987ffcbb325ad1f8db2a2dd6eaf514b6cbd2453e7658b9f6c9fb5c4c41dab
2 parents e9b6400 + cc3971c commit b972913

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/qt/psbtoperationsdialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ void PSBTOperationsDialog::saveTransaction() {
145145
if (filename.isEmpty()) {
146146
return;
147147
}
148-
std::ofstream out(filename.toLocal8Bit().data());
148+
std::ofstream out(filename.toLocal8Bit().data(), std::ofstream::out | std::ofstream::binary);
149149
out << ssTx.str();
150150
out.close();
151151
showStatus(tr("PSBT saved to disk."), StatusLevel::INFO);

src/qt/sendcoinsdialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ void SendCoinsDialog::on_sendButton_clicked()
434434
if (filename.isEmpty()) {
435435
return;
436436
}
437-
std::ofstream out(filename.toLocal8Bit().data());
437+
std::ofstream out(filename.toLocal8Bit().data(), std::ofstream::out | std::ofstream::binary);
438438
out << ssTx.str();
439439
out.close();
440440
Q_EMIT message(tr("PSBT saved"), "PSBT saved to disk", CClientUIInterface::MSG_INFORMATION);

0 commit comments

Comments
 (0)