当前位置: 首页>>代码示例>>Golang>>正文


Golang IEBEntry.GetChainIDHash方法代码示例

本文整理汇总了Golang中github.com/FactomProject/factomd/common/interfaces.IEBEntry.GetChainIDHash方法的典型用法代码示例。如果您正苦于以下问题:Golang IEBEntry.GetChainIDHash方法的具体用法?Golang IEBEntry.GetChainIDHash怎么用?Golang IEBEntry.GetChainIDHash使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在github.com/FactomProject/factomd/common/interfaces.IEBEntry的用法示例。


在下文中一共展示了IEBEntry.GetChainIDHash方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: InsertEntry

// InsertEntry inserts an entry
func (db *Overlay) InsertEntry(entry interfaces.IEBEntry) error {
	if entry == nil {
		return nil
	}

	//Entries are saved in buckets represented by their chainID for easy batch loading
	//They are also indexed in ENTRY bucket by their hash that points to their chainID
	//So they can be loaded in two load operations without needing to know their chainID

	batch := []interfaces.Record{}
	batch = append(batch, interfaces.Record{entry.GetChainID().Bytes(), entry.DatabasePrimaryIndex().Bytes(), entry})
	batch = append(batch, interfaces.Record{ENTRY, entry.DatabasePrimaryIndex().Bytes(), entry.GetChainIDHash()})

	return db.PutInBatch(batch)
}
开发者ID:FactomProject,项目名称:factomd,代码行数:16,代码来源:entry.go


注:本文中的github.com/FactomProject/factomd/common/interfaces.IEBEntry.GetChainIDHash方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。