Skip to content

Commit

Permalink
Merge pull request #3542 from marta-lokhova/ignore_adverts_when_outof…
Browse files Browse the repository at this point in the history
…sync

Ignore adverts and demands when out of sync

Reviewed-by: MonsieurNicolas
  • Loading branch information
latobarita authored Sep 22, 2022
2 parents f49b173 + dd33870 commit 39bee1a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/overlay/Peer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,7 @@ Peer::recvMessage(StellarMessage const& stellarMsg)
char const* cat = nullptr;
Scheduler::ActionType type = Scheduler::ActionType::NORMAL_ACTION;
auto msgType = stellarMsg.type();
bool ignoreIfOutOfSync = false;
switch (msgType)
{
// group messages used during handshake, process those synchronously
Expand Down Expand Up @@ -893,6 +894,7 @@ Peer::recvMessage(StellarMessage const& stellarMsg)

cat = "TX";
type = Scheduler::ActionType::DROPPABLE_ACTION;
ignoreIfOutOfSync = true;
break;
}

Expand All @@ -917,7 +919,7 @@ Peer::recvMessage(StellarMessage const& stellarMsg)
cat = "MISC";
}

if (!mApp.getLedgerManager().isSynced() && stellarMsg.type() == TRANSACTION)
if (!mApp.getLedgerManager().isSynced() && ignoreIfOutOfSync)
{
// For transactions, exit early during the state rebuild, as we can't
// properly verify them
Expand Down

0 comments on commit 39bee1a

Please sign in to comment.