BUG? 在非不可逆块应用get_ops_in_block API 返回结果为空

in #steemdev5 years ago

在我的一个程序中,我尝试用get_ops_in_block获取指定区块的内容,但是我发现一个诡异的事情,如果是比较新的区块,这个API返回空的结果。


(图源 :pexels.com)

经过我一系列测试,得出结论,只能对不可逆块应用get_ops_in_block,也就是说block编号小于last_irreversible_block_num的块。

一般情况不可逆块比最新块落后约20左右个区块(一分钟左右),如果对最新块或者这期间的20左右个块应用get_ops_in_block,就啥也取不到喽。

测试步骤 &结果

  • 获取最新块(head_block_number)

{"jsonrpc": "2.0", "method": "condenser_api.get_dynamic_global_properties", "params": [], "id": 1}

  • 调用get_ops_in_block,其中xxxx用最新块(head_block_number)

{"jsonrpc": "2.0", "method": "condenser_api.get_ops_in_block", "params": [xxxx], "id": 1}

  • 返回结果如下:

{'id': 1, 'jsonrpc': '2.0', 'result': []}

补充说明

当然,这可能就是这样设计的,不过如果我没记错的话,好像HF19的时候不是这样的,当然也可能是我记错了。

但是如果就是这样设计的,那么应该在文档里加上说明,至少我在文档里是没找到相关信息。
https://developers.steem.io/apidefinitions/#condenser_api.get_ops_in_block

我在github上提交了一个issue,看看官方咋说😀
https://github.com/steemit/steem/issues/3155


Vote For Me As Witness
https://steemit.com/~witnesses type in oflyhigh and click VOTE

Vote @oflyhigh via Steemconnect
Thank you!

Sort:  

Congratulations! This post has been upvoted from the communal account, @minnowsupport, by oflyhigh from the Minnow Support Project. It's a witness project run by aggroed, ausbitbank, teamsteem, someguy123, neoxian, followbtcnews, and netuoso. The goal is to help Steemit grow by supporting Minnows. Please find us at the Peace, Abundance, and Liberty Network (PALnet) Discord Channel. It's a completely public and open space to all members of the Steemit community who voluntarily choose to be there.

If you would like to delegate to the Minnow Support Project you can do so by clicking on the following links: 50SP, 100SP, 250SP, 500SP, 1000SP, 5000SP.
Be sure to leave at least 50SP undelegated on your account.

Coin Marketplace

STEEM 0.26
TRX 0.11
JST 0.033
BTC 64107.21
ETH 3073.84
USDT 1.00
SBD 3.88