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

Method GetTransaction

core/store/ledgerstore/block_store.go:372–380  ·  view source on GitHub ↗

GetTransaction return transaction by transaction hash

(txHash common.Uint256)

Source from the content-addressed store, hash-verified

370
371//GetTransaction return transaction by transaction hash
372func (this *BlockStore) GetTransaction(txHash common.Uint256) (*types.Transaction, uint32, error) {
373 if this.enableCache {
374 tx, height := this.cache.GetTransaction(txHash)
375 if tx != nil {
376 return tx, height, nil
377 }
378 }
379 return this.loadTransaction(txHash)
380}
381
382func (this *BlockStore) loadTransaction(txHash common.Uint256) (*types.Transaction, uint32, error) {
383 key := this.getTransactionKey(txHash)

Callers 1

GetBlockMethod · 0.95

Calls 2

loadTransactionMethod · 0.95
GetTransactionMethod · 0.65

Tested by

no test coverage detected