GetTransactionByHash get transactions by hash from blockchain
(param *types.ReqHashes)
| 281 | |
| 282 | // GetTransactionByHash get transactions by hash from blockchain |
| 283 | func (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 |
| 301 | func (q *QueueProtocol) GetMempool(req *types.ReqGetMempool) (*types.ReplyTxList, error) { |