Skip to content

Commit

Permalink
Load and save priority deltas in mempool dumps
Browse files Browse the repository at this point in the history
  • Loading branch information
luke-jr committed Mar 17, 2018
1 parent 400432d commit fd0fc2e
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/validation.cpp
Expand Up @@ -4580,14 +4580,8 @@ bool LoadMempool(void)
if (it != mapData.end()) {
try {
CDataStream ss(it->second, SER_DISK, CLIENT_VERSION);
std::map<uint256, std::pair<double, CAmount>> mapDeltas;
ss >> mapDeltas;
LOCK(mempool.cs);
for (const auto& it : mapDeltas) {
const uint256& txid = it.first;
const CAmount& amountdelta = it.second.second;
mempool.PrioritiseTransaction(txid, 0., amountdelta);
}
ss >> mempool.mapDeltas;
} catch (const std::exception& e) {
LogPrintf("Failed to deserialize mempool %s from disk: %s. Continuing anyway.\n", "deltas", e.what());
}
Expand Down Expand Up @@ -4672,9 +4666,7 @@ bool DumpMempool(void)

{
LOCK(mempool.cs);
for (const auto &i : mempool.mapDeltas) {
mapDeltas[i.first] = std::make_pair(0.0, i.second.second);
}
mapDeltas = mempool.mapDeltas;
vinfo = mempool.infoAll();
}

Expand Down

0 comments on commit fd0fc2e

Please sign in to comment.