Skip to content

Commit

Permalink
temp log
Browse files Browse the repository at this point in the history
  • Loading branch information
RainFallsSilent committed Jan 14, 2025
1 parent 0216217 commit b4c39e6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions dpos/manager/dposnormalhandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ func (h *DPOSNormalHandler) ChangeView(firstBlockHash *common.Uint256) {
// sign proposal with same view offset to me
for _, v := range h.proposalDispatcher.precociousProposals {
if h.consensus.GetViewOffset() == v.ViewOffset {
log.Info("### [OnViewChanged] sign proposal with same view offset to me, proposal:", v.Hash(), "offset:", v.ViewOffset, "sponsor:", common.BytesToHexString(v.Sponsor))
h.proposalDispatcher.ProcessProposal(peer.PID{}, v, false)
}
}
Expand Down
4 changes: 4 additions & 0 deletions dpos/manager/proposaldispatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ func (p *ProposalDispatcher) CleanProposals(changeView bool) {
p.signedTxs = map[common.Uint256]interface{}{}
p.pendingProposals = make(map[common.Uint256]*payload.DPOSProposal)
p.precociousProposals = make(map[common.Uint256]*payload.DPOSProposal)
log.Info("### Clean proposals precociousProposals:", len(p.precociousProposals))

p.eventAnalyzer.Clear()
} else {
Expand All @@ -235,6 +236,7 @@ func (p *ProposalDispatcher) CleanProposals(changeView bool) {
for k, v := range p.precociousProposals {
if v.ViewOffset < currentOffset {
delete(p.precociousProposals, k)
log.Info("### Delete precociousProposals:", v.Hash(), "offset:", v.ViewOffset, "sponsor:", common.BytesToHexString(v.Sponsor))
}
}
}
Expand Down Expand Up @@ -296,6 +298,7 @@ func (p *ProposalDispatcher) ProcessProposal(id peer.PID, d *payload.DPOSProposa
log.Info("have different view offset")
if d.ViewOffset > p.cfg.Consensus.GetViewOffset() {
p.precociousProposals[d.Hash()] = d
log.Info("### Add precociousProposals:", d.Hash(), "offset:", d.ViewOffset, "sponsor:", common.BytesToHexString(d.Sponsor))
}
return true, !self
}
Expand Down Expand Up @@ -390,6 +393,7 @@ func (p *ProposalDispatcher) UpdatePrecociousProposals() {
p.illegalMonitor.AddProposal(v)
}
delete(p.precociousProposals, k)
log.Info("### 2 Delete precociousProposals:", v.Hash(), "offset:", v.ViewOffset, "sponsor:", common.BytesToHexString(v.Sponsor))
}
}
}
Expand Down

0 comments on commit b4c39e6

Please sign in to comment.