예제 #1
0
func (db *Overlay) ProcessEBlockMultiBatch(eblock interfaces.DatabaseBlockWithEntries, checkForDuplicateEntries bool) error {
	//Each chain has its own number bucket, otherwise we would have conflicts
	numberBucket := append(ENTRYBLOCK_CHAIN_NUMBER, eblock.GetChainID().Bytes()...)
	err := db.ProcessBlockMultiBatch(ENTRYBLOCK, numberBucket, ENTRYBLOCK_SECONDARYINDEX, eblock)
	if err != nil {
		return err
	}
	return db.SaveIncludedInMultiFromBlockMultiBatch(eblock, checkForDuplicateEntries)
}
예제 #2
0
func (db *Overlay) SaveIncludedInMultiFromBlock(block interfaces.DatabaseBlockWithEntries, checkForDuplicateEntries bool) error {
	entries := block.GetEntryHashes()
	entries = append(entries, block.GetEntrySigHashes()...)
	hash := block.DatabasePrimaryIndex()

	return db.SaveIncludedInMulti(entries, hash, checkForDuplicateEntries)
}