Commit 8a94cf8
committed
Merge bitcoin/bitcoin#30635: rpc: add optional blockhash to waitfornewblock, unhide wait methods in help
c6e2c31 rpc: unhide waitfor{block,newblock,blockheight} (Sjors Provoost)
0786b75 rpc: 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-ACK c6e2c31
ryanofsky:
Code review ACK c6e2c31. Just rebased and tweaked documentation since last review.
glozow:
utACK c6e2c31
Tree-SHA512: 84a0c94cb9a2e4449e7a395cf3dce1650626bd852e30e0e238a1aafae19d57bf440bfac226fd4da44eaa8d1b2fa4a8c1177b6c716235ab862a72ff5bf8fc67acFile tree
3 files changed
+26
-7
lines changed- doc
- src/rpc
- test/functional
3 files changed
+26
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
| 274 | + | |
274 | 275 | | |
275 | 276 | | |
276 | 277 | | |
| |||
292 | 293 | | |
293 | 294 | | |
294 | 295 | | |
295 | | - | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
296 | 302 | | |
297 | | - | |
298 | | - | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
299 | 312 | | |
300 | 313 | | |
301 | 314 | | |
| |||
3461 | 3474 | | |
3462 | 3475 | | |
3463 | 3476 | | |
3464 | | - | |
3465 | | - | |
3466 | | - | |
| 3477 | + | |
| 3478 | + | |
| 3479 | + | |
3467 | 3480 | | |
3468 | 3481 | | |
3469 | 3482 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
593 | 593 | | |
594 | 594 | | |
595 | 595 | | |
596 | | - | |
| 596 | + | |
| 597 | + | |
597 | 598 | | |
598 | 599 | | |
599 | 600 | | |
| |||
0 commit comments