本文整理匯總了Golang中github.com/FactomProject/factomd/common/interfaces.IMsg.SetMinute方法的典型用法代碼示例。如果您正苦於以下問題:Golang IMsg.SetMinute方法的具體用法?Golang IMsg.SetMinute怎麽用?Golang IMsg.SetMinute使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/FactomProject/factomd/common/interfaces.IMsg
的用法示例。
在下文中一共展示了IMsg.SetMinute方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: FollowerExecuteMsg
// Messages that will go into the Process List must match an Acknowledgement.
// The code for this is the same for all such messages, so we put it here.
//
// Returns true if it finds a match, puts the message in holding, or invalidates the message
func (s *State) FollowerExecuteMsg(m interfaces.IMsg) {
s.Holding[m.GetMsgHash().Fixed()] = m
ack, _ := s.Acks[m.GetMsgHash().Fixed()].(*messages.Ack)
if ack != nil {
m.SetLeaderChainID(ack.GetLeaderChainID())
m.SetMinute(ack.Minute)
pl := s.ProcessLists.Get(ack.DBHeight)
pl.AddToProcessList(ack, m)
}
}
示例2: LeaderExecute
func (s *State) LeaderExecute(m interfaces.IMsg) {
_, ok := s.Replay.Valid(constants.INTERNAL_REPLAY, m.GetRepeatHash().Fixed(), m.GetTimestamp(), s.GetTimestamp())
if !ok {
delete(s.Holding, m.GetRepeatHash().Fixed())
delete(s.Holding, m.GetMsgHash().Fixed())
return
}
ack := s.NewAck(m).(*messages.Ack)
m.SetLeaderChainID(ack.GetLeaderChainID())
m.SetMinute(ack.Minute)
s.ProcessLists.Get(ack.DBHeight).AddToProcessList(ack, m)
}
示例3: FollowerExecuteRevealEntry
func (s *State) FollowerExecuteRevealEntry(m interfaces.IMsg) {
s.Holding[m.GetMsgHash().Fixed()] = m
ack, _ := s.Acks[m.GetMsgHash().Fixed()].(*messages.Ack)
if ack != nil {
m.SetLeaderChainID(ack.GetLeaderChainID())
m.SetMinute(ack.Minute)
pl := s.ProcessLists.Get(ack.DBHeight)
pl.AddToProcessList(ack, m)
// If we added the ack, then it will be cleared from the ack map.
if s.Acks[m.GetMsgHash().Fixed()] == nil {
msg := m.(*messages.RevealEntryMsg)
delete(s.Commits, msg.Entry.GetHash().Fixed())
// Okay the Reveal has been recorded. Record this as an entry that cannot be duplicated.
s.Replay.IsTSValid_(constants.REVEAL_REPLAY, msg.Entry.GetHash().Fixed(), msg.Timestamp, s.GetTimestamp())
}
}
}
示例4: LeaderExecuteRevealEntry
func (s *State) LeaderExecuteRevealEntry(m interfaces.IMsg) {
re := m.(*messages.RevealEntryMsg)
eh := re.Entry.GetHash()
commit, rtn := re.ValidateRTN(s)
switch rtn {
case 0:
m.FollowerExecute(s)
case -1:
return
}
now := s.GetTimestamp()
// If we have already recorded a Reveal Entry with this hash in this period, just ignore.
if _, v := s.Replay.Valid(constants.REVEAL_REPLAY, eh.Fixed(), s.GetLeaderTimestamp(), now); !v {
return
}
ack := s.NewAck(m).(*messages.Ack)
m.SetLeaderChainID(ack.GetLeaderChainID())
m.SetMinute(ack.Minute)
// Put the acknowledgement in the Acks so we can tell if AddToProcessList() adds it.
s.Acks[m.GetMsgHash().Fixed()] = ack
s.ProcessLists.Get(ack.DBHeight).AddToProcessList(ack, m)
// If it was added, then get rid of the matching Commit.
if s.Acks[m.GetMsgHash().Fixed()] != nil {
m.FollowerExecute(s)
s.PutCommit(eh, commit)
} else {
// Okay the Reveal has been recorded. Record this as an entry that cannot be duplicated.
s.Replay.IsTSValid_(constants.REVEAL_REPLAY, eh.Fixed(), m.GetTimestamp(), now)
delete(s.Commits, eh.Fixed())
}
}