Skip to content

Commit

Permalink
Merge pull request #996 from quantumagi/fixscheduledvotes
Browse files Browse the repository at this point in the history
Initialize "scheduledVotingData" on node start-up
  • Loading branch information
fassadlr authored Jun 17, 2022
2 parents da0079b + d1a7978 commit 4b1a308
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Stratis.Bitcoin.Features.PoA/PoAFeature.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,18 @@ public override Task InitializeAsync()

this.federationHistory.Initialize();

if (this.federationManager.IsFederationMember && this.federationManager.CurrentFederationKey != null)
{
foreach (Poll poll in this.votingManager.GetPendingPolls())
{
if (poll.VotingData.Key == VoteKey.AddFederationMember
&& !poll.PubKeysHexVotedInFavor.Any(v => v.PubKey == this.federationManager.CurrentFederationKey.PubKey.ToHex()))
{
this.votingManager.ScheduleVote(poll.VotingData);
}
}
}

// If the node is started in devmode, its role must be of miner in order to mine.
// If devmode is not specified, initialize mining as per normal.
if (this.nodeSettings.DevMode == null || this.nodeSettings.DevMode == DevModeNodeRole.Miner)
Expand Down

0 comments on commit 4b1a308

Please sign in to comment.