本文整理匯總了Golang中github.com/FactomProject/factomd/common/interfaces.IMsg.GetHash方法的典型用法代碼示例。如果您正苦於以下問題:Golang IMsg.GetHash方法的具體用法?Golang IMsg.GetHash怎麽用?Golang IMsg.GetHash使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/FactomProject/factomd/common/interfaces.IMsg
的用法示例。
在下文中一共展示了IMsg.GetHash方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: MatchAckFollowerExecute
// Messages that match an acknowledgement, and are added to the process list
// all do the same thing. So that logic is here.
func (s *State) MatchAckFollowerExecute(m interfaces.IMsg) error {
acks := s.GetAcks()
ack, ok := acks[m.GetHash().Fixed()].(*messages.Ack)
if !ok || ack == nil {
s.GetHolding()[m.GetHash().Fixed()] = m
} else {
processlist := s.GetProcessList()[ack.ServerIndex]
for len(processlist) < ack.Height+1 {
processlist = append(processlist, nil)
}
processlist[ack.Height] = m
s.GetProcessList()[ack.ServerIndex] = processlist
delete(acks, m.GetHash().Fixed())
}
return nil
}
示例2: MsgIsNew
// Returns true if message is new
func MsgIsNew(msg interfaces.IMsg) bool {
oldsync.Lock()
defer oldsync.Unlock()
return old[msg.GetHash().Fixed()] == nil
}
示例3: SetMsg
func SetMsg(msg interfaces.IMsg) {
oldsync.Lock()
old[msg.GetHash().Fixed()] = msg
oldsync.Unlock()
}
示例4: AddOldMsgs
func (p *ProcessList) AddOldMsgs(m interfaces.IMsg) {
p.oldmsgslock.Lock()
defer p.oldmsgslock.Unlock()
p.OldMsgs[m.GetHash().Fixed()] = m
}