aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2017-02-21 09:50:37 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2017-02-21 12:34:23 +0100
commit7d46b3ea8d6cd835bd0bbd3e8e9a6d7a6a536c31 (patch)
treeb86fa1b03562671fe3914f7414ca9995a590e36c
parent7639d38f14b1517c56856a2be4bd13f9d51ddf79 (diff)
parent171fc91f061d4a980eedfa522e302b8598408cc5 (diff)
Merge #9813: Read/write mempool.dat as a binary.
171fc91 Read/write mempool.dat as a binary. (Pavel Janík)
-rw-r--r--src/validation.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/validation.cpp b/src/validation.cpp
index 00f29eb62e..cad1c9c160 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -4180,7 +4180,7 @@ static const uint64_t MEMPOOL_DUMP_VERSION = 1;
bool LoadMempool(void)
{
int64_t nExpiryTimeout = GetArg("-mempoolexpiry", DEFAULT_MEMPOOL_EXPIRY) * 60 * 60;
- FILE* filestr = fopen((GetDataDir() / "mempool.dat").string().c_str(), "r");
+ FILE* filestr = fopen((GetDataDir() / "mempool.dat").string().c_str(), "rb");
CAutoFile file(filestr, SER_DISK, CLIENT_VERSION);
if (file.IsNull()) {
LogPrintf("Failed to open mempool file from disk. Continuing anyway.\n");
@@ -4261,7 +4261,7 @@ void DumpMempool(void)
int64_t mid = GetTimeMicros();
try {
- FILE* filestr = fopen((GetDataDir() / "mempool.dat.new").string().c_str(), "w");
+ FILE* filestr = fopen((GetDataDir() / "mempool.dat.new").string().c_str(), "wb");
if (!filestr) {
return;
}