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

Method GetSysFeeAmount

core/store/ledgerstore/block_store.go:210–223  ·  view source on GitHub ↗

GetSysFeeAmount return the sys fee for block by block hash

(blockHash common.Uint256)

Source from the content-addressed store, hash-verified

208
209//GetSysFeeAmount return the sys fee for block by block hash
210func (this *BlockStore) GetSysFeeAmount(blockHash common.Uint256) (common.Fixed64, error) {
211 key := this.getHeaderKey(blockHash)
212 data, err := this.store.Get(key)
213 if err != nil {
214 return common.Fixed64(0), err
215 }
216 source := common.NewZeroCopySource(data)
217 var fee common.Fixed64
218 err = fee.Deserialization(source)
219 if err != nil {
220 return common.Fixed64(0), err
221 }
222 return fee, nil
223}
224
225func (this *BlockStore) loadHeader(blockHash common.Uint256) (*types.Header, error) {
226 rawHeader, err := this.loadRawHeader(blockHash)

Callers 1

TestSaveHeaderFunction · 0.45

Calls 3

getHeaderKeyMethod · 0.95
DeserializationMethod · 0.95
GetMethod · 0.65

Tested by 1

TestSaveHeaderFunction · 0.36