As noted in https://github.com/bitcoin/bitcoin/issues/20959, PSBT files should be opened in binary mode as on windows, all newlines are turned into CRLF which produces invalid PSBTs.
Write PSBTs to file with binary mode #188
pull achow101 wants to merge 1 commits into bitcoin-core:master from achow101:bin-mode-psbts changing 2 files +2 −2-
achow101 commented at 1:57 am on January 19, 2021: member
-
GUI: Write PSBTs to file with binary mode cc3971c9ff
-
MarcoFalke added this to the milestone 0.21.1 on Jan 19, 2021
-
MarcoFalke added the label windows on Jan 21, 2021
-
MarcoFalke renamed this:
GUI: Write PSBTs to file with binary mode
Write PSBTs to file with binary mode
on Jan 21, 2021 -
MarcoFalke commented at 6:03 pm on January 21, 2021: contributorApproach ACK. Is there a way to test this on non-windows?
-
hebasto commented at 5:45 pm on February 22, 2021: member
Concept ACK.
For reference: https://en.cppreference.com/w/cpp/io/c/FILE#Binary_and_text_modes
-
hebasto commented at 5:49 pm on February 22, 2021: member@Quantris Does this pr fix https://github.com/bitcoin/bitcoin/issues/20959 for you?
-
Talkless approved
-
Talkless commented at 6:17 pm on March 11, 2021: none
utACK cc3971c9ff538a924c1a76ca1352bcaeb24f579f.
I DID test, but only on Linux (Debian Sid with Qt 5.15.2). I’ve created
.psbt
with PR version, imported into master version, and was able to sing and broadcast (regtest), so at least I don’t see regressions in Linux. -
MarcoFalke merged this on Mar 11, 2021
-
MarcoFalke closed this on Mar 11, 2021
-
MarcoFalke referenced this in commit 3a12672419 on Mar 11, 2021
-
MarcoFalke commented at 8:16 pm on March 11, 2021: contributorBackported in https://github.com/bitcoin/bitcoin/pull/20901
-
sidhujag referenced this in commit 92e4f92429 on Mar 11, 2021
-
Quantris commented at 9:25 am on June 10, 2021: none
@Quantris Does this pr fix bitcoin/bitcoin#20959 for you?
Sorry I missed replying to this at the time. I’m not really set up to build the project myself so I wouldn’t have been able to test this without someone providing a binary.
I can affirm that the issue seems fixed in 0.21.1 which includes this change; I tested in Win10 with the following steps in a watch-only wallet:
- create a partial transaction & save to file test.psbt (during this process it is also copied to clipboard in base64)
- load from clipboard, confirm it displays as expected & save to another file test2.psbt
- load from file test.psbt, confirm it displays as expected
- load from file test2.psbt, confirm it displays as expected
The same process in 0.21.0 fails in steps 3 & 4.
I also looked around a bit for info on testing this kind of issue. Unfortunately I didn’t find anything that makes text-mode vs. binary-mode distinguishable in linux (I was thinking maybe there would be some kind of env var or build flag for the stdlib). IOW seems like the only way to test this would be to run the tests in a Windows env.
Thanks for the fix @achow101 !
-
apoelstra referenced this in commit b27e9074ee on Sep 21, 2021
-
apoelstra referenced this in commit 2b372d3ab3 on Sep 21, 2021
-
apoelstra referenced this in commit 337297d605 on Sep 22, 2021
-
gwillen referenced this in commit 4135bed184 on Jun 28, 2022
-
bitcoin-core locked this on Aug 16, 2022
This is a metadata mirror of the GitHub repository bitcoin-core/gui. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-22 01:20 UTC
More mirrored repositories can be found on mirror.b10c.me