mempool.dat
is a binary file and thus it should be read/written as such.
Fixes #9810.
I can’t test on Windows though.
mempool.dat
is a binary file and thus it should be read/written as such.
Fixes #9810.
I can’t test on Windows though.
mempool.dat is a binary file and thus it should be read/written as such.
Fixes #9810.
Obviously correct ACK https://github.com/bitcoin/bitcoin/pull/9813/commits/171fc91f061d4a980eedfa522e302b8598408cc5
0<paveljanik> binary on write?
1<paveljanik> Windows...
2<wumpus> that could be the explanation, good catch! how is the file opened?
3<wumpus> if its opened in text (instead of binary) mode, windows will convert \n to \r\n
4<paveljanik> it is written with "w" and opened with "r"
5<wumpus> that should be "wb" and "rb"
6<wumpus> so you've found the issue, congrats
I wonder if we have any more instances of this.
Edit: no, I’ve grepped for uses for r
and rw
and w
on fopen, and the other cases all deal with text files (log file, pid file) or are only applicable to POSIX platforms (/dev/urandom
in secp256k1 tests).
ACK 171fc91f061d4a980eedfa522e302b8598408cc5
Tested on windows 10 and ubuntu 16.04.
0
1Edit: It works. It is overwriting the old mempool.dat properly.
paveljanik
laanwj
theuni
achow101
gmaxwell
fanquake
jonasschnelli
Milestone
0.14.0