mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 20:12:57 +01:00
Merge #9813: Read/write mempool.dat as a binary.
171fc91
Read/write mempool.dat as a binary. (Pavel Janík)
This commit is contained in:
parent
199b07a892
commit
8d2edc4698
@ -4501,7 +4501,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");
|
||||
@ -4582,7 +4582,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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user