You are viewing a single comment's thread from:

RE: One month os $HBD interest payments,; what does it tell us?

in #hbd3 months ago

A little add on: live or not, block range is always superior imo.
If you query blocks out of range, nothing bad happens. you just need to count yourself, as for some stupid reason, the reply does not include the block_number.
for extra safety I use blockhash and 'previous' to serialize 100% failproof

Sort:  

The reason it makes sense to fetch one block at a time in aiohivebot is that I'm using async tasks, one for every public API node. So if one task is processing one block, and processing takes longer than it takes for the next block to arive, another task is going to pick up the next task even if the other task is still bussy.

since it's only 1 block every 3 secs, I don't need to use async for anything.
It complicates things, as different nodes sometimes are on a different head_block.
The call time for range is about the same as for single blocks, so I use the one call for all cases. (range = 0 queries a single block, just without the explicit block num in the reply, which I think is ridiculous)

Thank you for your witness vote!
Have a !BEER on me!
To Opt-Out of my witness beer program just comment STOP below


Hey @pibara, here is a little bit of BEER from @isnochys for you. Enjoy it!

Learn how to earn FREE BEER each day by staking your BEER.


Hey @pibara, here is a little bit of BEER from @isnochys for you. Enjoy it!

We love your support by voting @detlev.witness on HIVE .

Thank you for your witness vote!
Have a !BEER on me!
To Opt-Out of my witness beer program just comment STOP below