web3.eth.getUncle
返回指定索引的叔伯块。
调用方法:
web3.eth.getUncle(blockHashStringOrNumber, uncleNumber [, returnTransactionObjects] [, callback])
参数:
blockHashStringOrNumber
:String|Number ,块编号或哈希值,或者字符串常量:"earliest"、"latest" 、 "pending"uncleNumber
:Number,叔伯块索引returnTransactionObjects
:Boolean,可选,默认值为false,如果设置为true,则返回的块中将包含完整的所有交易的完整数据,否则仅返回交易的哈希值。callback
:Function,可选,如果使用回调函数,则通过异步http向节点API发送请求。
返回值:
Object
- 叔伯块对象,内容参考web3.eth.getBlock()
提示:叔伯块中不包含单个交易。
示例代码:
var uncle = web3.eth.getUncle(500, 0);
console.log(uncle); // see web3.eth.getBlock