Changeset View
Changeset View
Standalone View
Standalone View
doc/developer-notes.md
Show First 20 Lines • Show All 907 Lines • ▼ Show 20 Lines | - Wallet RPCs call BlockUntilSyncedToCurrentChain to maintain consistency with | ||||
- *Rationale*: In previous versions of Bitcoin Core, the wallet was always | - *Rationale*: In previous versions of Bitcoin Core, the wallet was always | ||||
in-sync with the chainstate (by virtue of them all being updated in the | in-sync with the chainstate (by virtue of them all being updated in the | ||||
same cs_main lock). In order to maintain the behavior that wallet RPCs | same cs_main lock). In order to maintain the behavior that wallet RPCs | ||||
return results as of at least the highest best-known block an RPC | return results as of at least the highest best-known block an RPC | ||||
client may be aware of prior to entering a wallet RPC call, we must block | client may be aware of prior to entering a wallet RPC call, we must block | ||||
until the wallet is caught up to the chainstate as of the RPC call's entry. | until the wallet is caught up to the chainstate as of the RPC call's entry. | ||||
This also makes the API much easier for RPC clients to reason about. | This also makes the API much easier for RPC clients to reason about. | ||||
- Be aware of RPC method aliases and generally avoid registering the same | |||||
callback function pointer for different RPCs. | |||||
- *Rationale*: RPC methods registered with the same function pointer will be | |||||
considered aliases and only the first method name will show up in the | |||||
`help` rpc command list. | |||||
- *Exception*: Using RPC method aliases may be appropriate in cases where a | |||||
new RPC is replacing a deprecated RPC, to avoid both RPCs confusingly | |||||
showing up in the command list. |