Detecting stale blocks with ZeroMQ

1

I'am writing an application which receives information about new tx and blocks via ZeroMQ. There is a chance that I will receive notifs about blocks which will later on become stale blocks. Is there a way to verify whether the block has become stale?

Maciej MoĊ›cicki

Posted 2018-07-18T14:12:32.540

Reputation: 13

Answers

1

I don't believe there is a direct way to do this via ZeroMQ. Your best bet would be to validate the ancestry for each block as you receive it.

When you receive a block, check its parent hash against blocks you have already seen. If the parent chain validates and you do not have another, longer child chain from the parent block already, you can accept this block.

Raghav Sood

Posted 2018-07-18T14:12:32.540

Reputation: 10 897