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


Golang IHash.Fixed方法代碼示例

本文整理匯總了Golang中github.com/FactomProject/factomd/common/interfaces.IHash.Fixed方法的典型用法代碼示例。如果您正苦於以下問題:Golang IHash.Fixed方法的具體用法?Golang IHash.Fixed怎麽用?Golang IHash.Fixed使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在github.com/FactomProject/factomd/common/interfaces.IHash的用法示例。


在下文中一共展示了IHash.Fixed方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: PutCommit

func (s *State) PutCommit(hash interfaces.IHash, msg interfaces.IMsg) {
	cs := s.Commits[hash.Fixed()]
	if cs == nil {
		cs = make([]interfaces.IMsg, 0)
	}
	s.Commits[hash.Fixed()] = append(cs, msg)
}
開發者ID:FactomProject,項目名稱:factomd,代碼行數:7,代碼來源:stateConsensus.go

示例2: NextCommit

// Returns the oldest, not processed, Commit received
func (s *State) NextCommit(hash interfaces.IHash) interfaces.IMsg {
	cs := s.Commits[hash.Fixed()]
	if cs == nil {
		return nil
	}

	if len(cs) == 0 {
		delete(s.Commits, hash.Fixed())
		return nil
	}

	r := cs[0]

	copy(cs[:], cs[1:])
	cs[len(cs)-1] = nil
	s.Commits[hash.Fixed()] = cs[:len(cs)-1]

	return r
}
開發者ID:FactomProject,項目名稱:factomd,代碼行數:20,代碼來源:stateConsensus.go

示例3: IsTSValid

// Checks if the timestamp is valid.  If the timestamp is too old or
// too far into the future, then we don't consider it valid.  Or if we
// have seen this hash before, then it is not valid.  To that end,
// this code remembers hashes tested in the past, and rejects the
// second submission of the same hash.
func (r *Replay) IsTSValid(mask int, hash interfaces.IHash, timestamp interfaces.Timestamp) bool {
	return r.IsTSValid_(mask, hash.Fixed(), timestamp, primitives.NewTimestampNow())
}
開發者ID:FactomProject,項目名稱:factomd,代碼行數:8,代碼來源:replay.go

示例4: AddNewEntry

func (p *ProcessList) AddNewEntry(key interfaces.IHash, value interfaces.IEntry) {
	p.NewEntriesMutex.Lock()
	defer p.NewEntriesMutex.Unlock()
	p.NewEntries[key.Fixed()] = value
}
開發者ID:FactomProject,項目名稱:factomd,代碼行數:5,代碼來源:processList.go

示例5: DeleteNewEntry

func (p *ProcessList) DeleteNewEntry(key interfaces.IHash) {
	p.NewEntriesMutex.Lock()
	defer p.NewEntriesMutex.Unlock()
	delete(p.NewEntries, key.Fixed())
}
開發者ID:FactomProject,項目名稱:factomd,代碼行數:5,代碼來源:processList.go

示例6: DeleteEBlocks

func (p *ProcessList) DeleteEBlocks(key interfaces.IHash) {
	p.neweblockslock.Lock()
	defer p.neweblockslock.Unlock()
	delete(p.NewEBlocks, key.Fixed())
}
開發者ID:FactomProject,項目名稱:factomd,代碼行數:5,代碼來源:processList.go

示例7: GetNewEBlocks

func (p *ProcessList) GetNewEBlocks(key interfaces.IHash) interfaces.IEntryBlock {
	p.neweblockslock.Lock()
	defer p.neweblockslock.Unlock()
	return p.NewEBlocks[key.Fixed()]
}
開發者ID:FactomProject,項目名稱:factomd,代碼行數:5,代碼來源:processList.go

示例8: AddNewEBlocks

func (p *ProcessList) AddNewEBlocks(key interfaces.IHash, value interfaces.IEntryBlock) {
	p.neweblockslock.Lock()
	defer p.neweblockslock.Unlock()
	p.NewEBlocks[key.Fixed()] = value
}
開發者ID:FactomProject,項目名稱:factomd,代碼行數:5,代碼來源:processList.go

示例9: GetOldMsgs

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

示例10: DeleteOldMsgs

func (p *ProcessList) DeleteOldMsgs(key interfaces.IHash) {
	p.oldmsgslock.Lock()
	defer p.oldmsgslock.Unlock()
	delete(p.OldMsgs, key.Fixed())
}
開發者ID:FactomProject,項目名稱:factomd,代碼行數:5,代碼來源:processList.go


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