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

Method ContainTransaction

core/store/ledgerstore/block_store.go:413–429  ·  view source on GitHub ↗

IsContainTransaction return whether the transaction is in store

(txHash common.Uint256)

Source from the content-addressed store, hash-verified

411
412//IsContainTransaction return whether the transaction is in store
413func (this *BlockStore) ContainTransaction(txHash common.Uint256) (bool, error) {
414 key := this.getTransactionKey(txHash)
415
416 if this.enableCache {
417 if this.cache.ContainTransaction(txHash) {
418 return true, nil
419 }
420 }
421 _, err := this.store.Get(key)
422 if err != nil {
423 if err == scom.ErrNotFound {
424 return false, nil
425 }
426 return false, err
427 }
428 return true, nil
429}
430
431//GetVersion return the version of store
432func (this *BlockStore) GetVersion() (byte, error) {

Callers

nothing calls this directly

Calls 3

getTransactionKeyMethod · 0.95
ContainTransactionMethod · 0.65
GetMethod · 0.65

Tested by

no test coverage detected