MCPcopy Create free account
hub / github.com/DNAProject/DNA / AddBlock

Method AddBlock

core/ledger/ledger.go:70–76  ·  view source on GitHub ↗
(block *types.Block, stateMerkleRoot common.Uint256)

Source from the content-addressed store, hash-verified

68}
69
70func (self *Ledger) AddBlock(block *types.Block, stateMerkleRoot common.Uint256) error {
71 err := self.ldgStore.AddBlock(block, stateMerkleRoot)
72 if err != nil {
73 log.Errorf("Ledger AddBlock BlockHeight:%d BlockHash:%x error:%s", block.Header.Height, block.Hash(), err)
74 }
75 return err
76}
77
78func (self *Ledger) ExecuteBlock(b *types.Block) (store.ExecuteResult, error) {
79 return self.ldgStore.ExecuteBlock(b)

Callers 1

mainFunction · 0.95

Calls 3

ErrorfFunction · 0.92
AddBlockMethod · 0.65
HashMethod · 0.65

Tested by

no test coverage detected