mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-15 16:38:23 +01:00
c6e2c31c55rpc: unhide waitfor{block,newblock,blockheight} (Sjors Provoost)0786b7509arpc: add optional blockhash to waitfornewblock (Sjors Provoost) Pull request description: 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, the `waitfor{block,newblock,blockheight}` RPC methods are no longer hidden in `help`: - the changes in #30409 ensured these methods _could_ work in the GUI - #31785 removed the guards that prevented GUI users from using them - this PR makes `waitfornewblock` reliable So there's no more reason to hide them. ACKs for top commit: TheCharlatan: Re-ACKc6e2c31c55ryanofsky: Code review ACKc6e2c31c55. Just rebased and tweaked documentation since last review. glozow: utACKc6e2c31c55Tree-SHA512: 84a0c94cb9a2e4449e7a395cf3dce1650626bd852e30e0e238a1aafae19d57bf440bfac226fd4da44eaa8d1b2fa4a8c1177b6c716235ab862a72ff5bf8fc67ac
33 KiB
Executable File
33 KiB
Executable File