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

Method AddTransaction

core/store/ledgerstore/block_cache.go:86–92  ·  view source on GitHub ↗

AddTransaction add transaction to block cache

(tx *types.Transaction, height uint32)

Source from the content-addressed store, hash-verified

84
85//AddTransaction add transaction to block cache
86func (this *BlockCache) AddTransaction(tx *types.Transaction, height uint32) {
87 txHash := tx.Hash()
88 this.transactionCache.Add(string(txHash.ToArray()), &TransactionCacheaValue{
89 Tx: tx,
90 Height: height,
91 })
92}
93
94//GetTransaction return transaction by transaction hash from cache
95func (this *BlockCache) GetTransaction(txHash common.Uint256) (*types.Transaction, uint32) {

Callers 2

TransactionHandleFunction · 0.80
SaveTransactionMethod · 0.80

Calls 3

AddMethod · 0.80
HashMethod · 0.65
ToArrayMethod · 0.65

Tested by

no test coverage detected