You are viewing a single comment's thread from:

RE: Everything can be faster on Hive - hive-js & dhive new changes

in HiveDevs3 years ago

Thank you for the detailed info, learned something!
In a scenario like eg.: a scheduled post. Would it make sense to still use broadcast_transaction_synchronous and would a success response pretty much guarantee a success or would you recommend broadcast_transaction, followed by eg. an attempt to retrieve the post? Or is a transaction 'guaranteed' only after its block number is less or equal to 'last_irreversible_block_num'?

On a side node, I've recently checked the various implementations of client libraries and noticed that for broadcasting transactions some library chose 'ref_block_num' equal to value of 'head_block_number' and other library uses 'last_irreversible_block_num-1'. Is there a difference and does it matter which block a transaction uses as a 'ref_block_num'?

I'm asking in order to comprehend how things work so I can learn what the preferred usage is.

Sort:  
 3 years ago  

The synchronous method is deprecated and most likely will be dropped soon. So use the other one. The suggested API for checking transaction status is transaction_status_api.find_transaction. You can find it in the devportal. developers.hive.io

Yes, when the transaction is included in a irreversible block, there is no way for that to reverse or fail.

AFAIK for ref_block_num it doesn't matter. It can be any recent block.