MCPcopy Create free account
hub / github.com/33cn/chain33 / GetTransactionByHash

Method GetTransactionByHash

client/queueprotocol.go:283–298  ·  view source on GitHub ↗

GetTransactionByHash get transactions by hash from blockchain

(param *types.ReqHashes)

Source from the content-addressed store, hash-verified

281
282// GetTransactionByHash get transactions by hash from blockchain
283func (q *QueueProtocol) GetTransactionByHash(param *types.ReqHashes) (*types.TransactionDetails, error) {
284 if param == nil {
285 err := types.ErrInvalidParam
286 log.Error("GetTransactionByHash", "Error", err)
287 return nil, err
288 }
289 msg, err := q.send(blockchainKey, types.EventGetTransactionByHash, param)
290 if err != nil {
291 log.Error("GetTransactionByHash", "Error", err.Error())
292 return nil, err
293 }
294 if reply, ok := msg.GetData().(*types.TransactionDetails); ok {
295 return reply, nil
296 }
297 return nil, types.ErrTypeAsset
298}
299
300// GetMempool get transactions from mempool
301func (q *QueueProtocol) GetMempool(req *types.ReqGetMempool) (*types.ReplyTxList, error) {

Callers

nothing calls this directly

Calls 3

sendMethod · 0.95
ErrorMethod · 0.65
GetDataMethod · 0.65

Tested by

no test coverage detected