MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / loadDatabase

Function loadDatabase

blockproducer/storage.go:664–690  ·  view source on GitHub ↗
(st xi.Storage)

Source from the content-addressed store, hash-verified

662}
663
664func loadDatabase(st xi.Storage) (
665 irre *blockNode,
666 heads []*blockNode,
667 immutable *metaState,
668 txPool map[hash.Hash]pi.Transaction,
669 err error,
670) {
671 var irreHash hash.Hash
672 // Load last irreversible block hash
673 if irreHash, err = loadIrreHash(st); err != nil {
674 return
675 }
676 // Load blocks
677 if irre, heads, err = loadBlocks(st, irreHash); err != nil {
678 return
679 }
680 // Load immutable state
681 if immutable, err = loadImmutableState(st); err != nil {
682 return
683 }
684 // Load tx pool
685 if txPool, err = loadTxPool(st); err != nil {
686 return
687 }
688
689 return
690}

Callers 1

NewChainWithContextFunction · 0.85

Calls 4

loadIrreHashFunction · 0.85
loadBlocksFunction · 0.85
loadImmutableStateFunction · 0.85
loadTxPoolFunction · 0.85

Tested by

no test coverage detected