Browse Source

avoid deadlock

pull/8127/head
tycho garen 3 years ago
committed by M. J. Fromberger
parent
commit
82de1d7524
2 changed files with 5 additions and 2 deletions
  1. +0
    -1
      internal/consensus/common_test.go
  2. +5
    -1
      internal/consensus/state.go

+ 0
- 1
internal/consensus/common_test.go View File

@ -227,7 +227,6 @@ func sortVValidatorStubsByPower(ctx context.Context, t *testing.T, vss []*valida
func startTestRound(ctx context.Context, cs *State, height int64, round int32) {
cs.enterNewRound(ctx, height, round)
cs.startRoutines(ctx, 0)
}
// Create proposal block from cs1 but sign it with vs.


+ 5
- 1
internal/consensus/state.go View File

@ -2097,7 +2097,11 @@ func (cs *State) defaultSetProposal(proposal *types.Proposal, recvTime time.Time
// TODO: We can check if Proposal is for a different block as this is a sign of misbehavior!
if cs.ProposalBlockParts == nil {
cs.metrics.MarkBlockGossipStarted()
cs.ProposalBlockParts = types.NewPartSetFromHeader(proposal.BlockID.PartSetHeader)
func() {
cs.mtx.Lock()
defer cs.mtx.Unlock()
cs.ProposalBlockParts = types.NewPartSetFromHeader(proposal.BlockID.PartSetHeader)
}()
}
cs.logger.Info("received proposal", "proposal", proposal)


Loading…
Cancel
Save