Browse Source

Apply suggestions from code review

Co-authored-by: M. J. Fromberger <michael.j.fromberger@gmail.com>
pull/8127/head
Sam Kleinman 2 years ago
committed by M. J. Fromberger
parent
commit
53ab56bb9e
2 changed files with 6 additions and 8 deletions
  1. +4
    -6
      internal/consensus/state.go
  2. +2
    -2
      node/node.go

+ 4
- 6
internal/consensus/state.go View File

@ -2087,12 +2087,10 @@ func (cs *State) defaultSetProposal(proposal *types.Proposal, recvTime time.Time
}
proposal.Signature = p.Signature
func() {
cs.mtx.Lock()
defer cs.mtx.RUnlock()
cs.Proposal = proposal
cs.ProposalReceiveTime = recvTime
}()
cs.mtx.Lock()
cs.Proposal = proposal
cs.ProposalReceiveTime = recvTime
cs.mtx.Unlock()
cs.calculateProposalTimestampDifferenceMetric()
// We don't update cs.ProposalBlockParts if it is already set.
// This happens if we're already in cstypes.RoundStepCommit or if there is a valid block in the current round.


+ 2
- 2
node/node.go View File

@ -470,8 +470,8 @@ func (n *nodeImpl) OnStart(ctx context.Context) error {
}
}
if n.config.Instrumentation.Prometheus && n.config.Instrumentation.PrometheusListenAddr != "" {
n.prometheusSrv = n.startPrometheusServer(ctx, n.config.Instrumentation.PrometheusListenAddr)
if p := n.config.Instrumentation; p.Prometheus && p.PrometheusListenAddr != "" {
n.prometheusSrv = n.startPrometheusServer(ctx, p.PrometheusListenAddr)
}
n.rpcEnv.NodeInfo = n.nodeInfo


Loading…
Cancel
Save