Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mempool] Mark mempool import fails that were found in mempool as 'already there' #11062

Merged
merged 1 commit into from Oct 18, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 13 additions & 4 deletions src/validation.cpp
Expand Up @@ -4278,8 +4278,9 @@ bool LoadMempool(void)
}

int64_t count = 0;
int64_t skipped = 0;
int64_t expired = 0;
int64_t failed = 0;
int64_t already_there = 0;
int64_t nNow = GetTime();

try {
Expand Down Expand Up @@ -4309,10 +4310,18 @@ bool LoadMempool(void)
if (state.IsValid()) {
++count;
} else {
++failed;
// mempool may contain the transaction already, e.g. from
// wallet(s) having loaded it while we were processing
// mempool transactions; consider these as valid, instead of
// failed, but mark them as 'already there'
if (mempool.exists(tx->GetHash())) {
++already_there;
} else {
++failed;
}
}
} else {
++skipped;
++expired;
}
if (ShutdownRequested())
return false;
Expand All @@ -4328,7 +4337,7 @@ bool LoadMempool(void)
return false;
}

LogPrintf("Imported mempool transactions from disk: %i successes, %i failed, %i expired\n", count, failed, skipped);
LogPrintf("Imported mempool transactions from disk: %i succeeded, %i failed, %i expired, %i already there\n", count, failed, expired, already_there);
return true;
}

Expand Down