The waitfornewblock
is inherently racy as the tip may have changed since the last RPC call, and can even change during initial processing of this call.
Add an optional blockhash
argument so the caller can specify their current tip. Return immediately if our tip is different.
I’ve made it fail if LookupBlockIndex
fails. This should never happen if the user got the block hash from our RPC in the first place.
Finally, waitfornewblock
is no longer hidden in help
.