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) }
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) }