diff --git a/sqlitecluster/SQLiteNode.cpp b/sqlitecluster/SQLiteNode.cpp index d40372b92..74339d29f 100644 --- a/sqlitecluster/SQLiteNode.cpp +++ b/sqlitecluster/SQLiteNode.cpp @@ -1283,7 +1283,7 @@ void SQLiteNode::_onMESSAGE(SQLitePeer* peer, const SData& message) { // represents ~30s of commits. If we're behind, let's close the command port // so we can catch up with the cluster before processing new commands. const string blockReason = "COMMITS_LAGGING_BEHIND"; - const int64_t currentCommitDifference = getCommitCount() - peer->commitCount; + const int64_t currentCommitDifference = peer->commitCount - getCommitCount(); if (peer == _leadPeer && currentCommitDifference >= 12'500 && !_blockedCommandPort) { SINFO("Node is lagging behind, closing command port so it can catch up."); _server.blockCommandPort(blockReason);