Commit d0ed369
committed
Merge bitcoin#34049: rpc: Disallow captures in RPCMethodImpl
5a81d73 scripted-diff: rpc: Don't pointlessly capture in RPCMethod lambdas (Anthony Towns)
4e78929 scripted-diff: rpc: Rename RPCHelpMan to RPCMethod (Anthony Towns)
Pull request description:
When defining `RPCHelpMan` objects, we usually return a lambda, and mostly we define those via `[&](...) { ... }` which explicitly captures any parameters or local variables by reference. If we were to actually use any of those captures (we don't), we would invoke undefined behaviour. So instead, convert all the `[&]` to `[]` to avoid capturing.
While we're at it, rename `RPCHelpMan` to `RPCMethod`, reflecting its greater responsibility since bitcoin#19386.
ACKs for top commit:
maflcko:
review ACK 5a81d73 🏣
stickies-v:
ACK 5a81d73
rkrux:
code review ACK 5a81d73
Tree-SHA512: 72e9232857ba5bf4c346fb963a2028047f7c7e9b420ef58b3108669204bfbb6952342cfcfd2e8a06f813a21545abf7fc8b0ad422f00d7ec9c1134626cd1650e6File tree
27 files changed
+577
-577
lines changed- src
- qt/test
- rpc
- test
- wallet/rpc
- zmq
27 files changed
+577
-577
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
711 | 711 | | |
712 | 712 | | |
713 | 713 | | |
714 | | - | |
| 714 | + | |
715 | 715 | | |
716 | 716 | | |
717 | 717 | | |
| |||
738 | 738 | | |
739 | 739 | | |
740 | 740 | | |
741 | | - | |
| 741 | + | |
742 | 742 | | |
743 | 743 | | |
744 | 744 | | |
| |||
0 commit comments