MCPcopy Create free account
hub / github.com/CPChain/chain / hasAllBlocks

Function hasAllBlocks

protocols/cpc/api.go:215–223  ·  view source on GitHub ↗
(chain *core.BlockChain, bs []*types.Block)

Source from the content-addressed store, hash-verified

213}
214
215func hasAllBlocks(chain *core.BlockChain, bs []*types.Block) bool {
216 for _, b := range bs {
217 if !chain.HasBlock(b.Hash(), b.NumberU64()) {
218 return false
219 }
220 }
221
222 return true
223}
224
225// ImportChain imports a blockchain from a local file.
226func (api *PrivateAdminAPI) ImportChain(file string) (bool, error) {

Callers 1

ImportChainMethod · 0.85

Calls 3

NumberU64Method · 0.80
HasBlockMethod · 0.65
HashMethod · 0.65

Tested by

no test coverage detected