From 994460ffa0d8d671fab5c5279744346a7b5629a8 Mon Sep 17 00:00:00 2001 From: MonsieurNicolas Date: Mon, 5 Mar 2018 16:42:47 -0800 Subject: [PATCH] SCP: properly trigger the startedBallotProtocol callback Old code would only trigger that callback in some but not all cases --- src/scp/BallotProtocol.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/scp/BallotProtocol.cpp b/src/scp/BallotProtocol.cpp index 01da089779..1f5466943c 100644 --- a/src/scp/BallotProtocol.cpp +++ b/src/scp/BallotProtocol.cpp @@ -390,7 +390,6 @@ BallotProtocol::bumpState(Value const& value, uint32 n) if (updated) { - mSlot.getSCPDriver().startedBallotProtocol(mSlot.getSlotIndex(), newb); emitCurrentStateStatement(); checkHeardFromQuorum(); } @@ -478,6 +477,12 @@ BallotProtocol::bumpToBallot(SCPBallot const& ballot, bool check) bool gotBumped = !mCurrentBallot || (mCurrentBallot->counter != ballot.counter); + if (!mCurrentBallot) + { + mSlot.getSCPDriver().startedBallotProtocol(mSlot.getSlotIndex(), + ballot); + } + mCurrentBallot = make_unique(ballot); if (gotBumped)