Exemplo n.º 1
0
func ExportAChain(db interfaces.DBOverlay) error {
	fmt.Printf("ExportAChain\n")
	// get all aBlocks from db
	aBlocks, err := db.FetchAllABlocks()
	if err != nil {
		return err
	}
	sort.Sort(util.ByABlockIDAccending(aBlocks))

	for _, block := range aBlocks {
		err = ExportBlock(block.(interfaces.DatabaseBatchable))
		if err != nil {
			return err
		}
	}
	return nil
}