當前位置: 首頁>>代碼示例>>Golang>>正文


Golang IMsg.GetHash方法代碼示例

本文整理匯總了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
}
開發者ID:jjdevbiz,項目名稱:factomd,代碼行數:18,代碼來源:state.go

示例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
}
開發者ID:FactomProject,項目名稱:factomd,代碼行數:6,代碼來源:NetworkTest.go

示例3: SetMsg

func SetMsg(msg interfaces.IMsg) {
	oldsync.Lock()
	old[msg.GetHash().Fixed()] = msg
	oldsync.Unlock()
}
開發者ID:FactomProject,項目名稱:factomd,代碼行數:5,代碼來源:NetworkTest.go

示例4: AddOldMsgs

func (p *ProcessList) AddOldMsgs(m interfaces.IMsg) {
	p.oldmsgslock.Lock()
	defer p.oldmsgslock.Unlock()
	p.OldMsgs[m.GetHash().Fixed()] = m
}
開發者ID:FactomProject,項目名稱:factomd,代碼行數:5,代碼來源:processList.go


注:本文中的github.com/FactomProject/factomd/common/interfaces.IMsg.GetHash方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。