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

Method putTransaction

core/store/ledgerstore/block_store.go:362–369  ·  view source on GitHub ↗
(tx *types.Transaction, height uint32)

Source from the content-addressed store, hash-verified

360}
361
362func (this *BlockStore) putTransaction(tx *types.Transaction, height uint32) {
363 txHash := tx.Hash()
364 key := this.getTransactionKey(txHash)
365 value := common.NewZeroCopySink(nil)
366 value.WriteUint32(height)
367 tx.Serialization(value)
368 this.store.BatchPut(key, value.Bytes())
369}
370
371//GetTransaction return transaction by transaction hash
372func (this *BlockStore) GetTransaction(txHash common.Uint256) (*types.Transaction, uint32, error) {

Callers 1

SaveTransactionMethod · 0.95

Calls 6

getTransactionKeyMethod · 0.95
WriteUint32Method · 0.95
BytesMethod · 0.95
HashMethod · 0.65
SerializationMethod · 0.65
BatchPutMethod · 0.65

Tested by

no test coverage detected