tx_getDiscardTransactions
查询所有非法交易。
Parameters
无
Returns
[<Transaction>]
- Transaction对象字段如下:
version
:<string>
- 平台版本号。hash
:<string>
- 32字节的十六进制字符串,交易哈希值。串,交易所在区块的哈希。from
:<string>
- 20字节的十六进制字符串,交易发送方的地址。to
:<string>
- 20字节的十六进制字符串,交易接收方的地址。amount
:<string>
- 转账金额。timestamp
:<number>
- 交易发生的unix时间戳(单位ns)。nonce
:<number>
- 16位随机数。extra
:<string>
- 交易的额外信息。payload
:<string>
- 部署合约、调用合约、升级合约的时候才有这个值,可以通过这个值追溯到合约调用的方法以及调用传入的参数。invalid
:<boolean>
- 交易是否不合法。invalidMsg
:<string>
- 交易的不合法信息。
不合法的交易invalid
值为true, invalidMsg
可能为:
- DEPLOY_CONTRACT_FAILED - 合约部署失败;
- INVOKE_CONTRACT_FAILED - 合约方法调用失败;
- SIGFAILED - 签名非法;
- OUTOFBALANCE - 余额不足;
- INVALID_PERMISSION - 合约操作权限不够;
Example1:正常的请求
- # Request
- curl -X POST --data '{"jsonrpc": "2.0", "namespace":"global", "method": "tx_getDiscardTransactions", "params": [], "id": 71}'
- # Response
- {
- "jsonrpc": "2.0",
- "namespace":"global",
- "id": 1,
- "code": 0,
- "message": "SUCCESS",
- "result": [
- {
- "version": "",
- "hash": "0x100ff931204d149f88c0778f6e7b8d4b11ba3c8c720f0cc3e204b46999954ed4",
- "from": "0x17d806c92fa941b4b7a8ffffc58fa2f297a3bffc",
- "to": "0x0000000000000000000000000000000000000000",
- "amount": "0x0",
- "timestamp": 1482405417011000000,
- "nonce": 6848885244669098,
- "extra": "",
- "payload": "0x60606040526002600055600256",
- "invalid": true,
- "invalidMsg": "DEPLOY_CONTRACT_FAILED"
- }
- ]
- }
Example2:若没有非法交易
- # Request
- curl -X POST --data '{"jsonrpc": "2.0", "namespace":"global", "method": "tx_getDiscardTransactions", "params": [], "id": 71}'
- # Response
- {
- "jsonrpc": "2.0",
- "namespace": "global",
- "id": 1,
- "code": -32001,
- "message": "Not found discard transactions "
- }
当前内容版权归 Hyperchain 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 Hyperchain .