|
| 1 | +# JSON-RPC Interface |
| 2 | + |
| 3 | +The headless daemon `bitcoind` has the JSON-RPC API enabled by default, the GUI |
| 4 | +`bitcoin-qt` has it disabled by default. This can be changed with the `-server` |
| 5 | +option. In the GUI it is possible to execute RPC methods in the Debug Console |
| 6 | +Dialog. |
| 7 | + |
| 8 | +## RPC consistency guarantees |
| 9 | + |
| 10 | +State that can be queried via RPCs is guaranteed to be at least up-to-date with |
| 11 | +the chain state immediately prior to the call's execution. However, the state |
| 12 | +returned by RPCs that reflect the mempool may not be up-to-date with the |
| 13 | +current mempool state. |
| 14 | + |
| 15 | +### Transaction Pool |
| 16 | + |
| 17 | +The mempool state returned via an RPC is consistent with itself and with the |
| 18 | +chain state at the time of the call. Thus, the mempool state only encompasses |
| 19 | +transactions that are considered mine-able by the node at the time of the RPC. |
| 20 | + |
| 21 | +The mempool state returned via an RPC reflects all effects of mempool and chain |
| 22 | +state related RPCs that returned prior to this call. |
| 23 | + |
| 24 | +### Wallet |
| 25 | + |
| 26 | +The wallet state returned via an RPC is consistent with itself and with the |
| 27 | +chain state at the time of the call. |
| 28 | + |
| 29 | +Wallet RPCs will return the latest chain state consistent with prior non-wallet |
| 30 | +RPCs. The effects of all blocks (and transactions in blocks) at the time of the |
| 31 | +call is reflected in the state of all wallet transactions. For example, if a |
| 32 | +block contains transactions that conflicted with mempool transactions, the |
| 33 | +wallet would reflect the removal of these mempool transactions in the state. |
| 34 | + |
| 35 | +However, the wallet may not be up-to-date with the current state of the mempool |
| 36 | +or the state of the mempool by an RPC that returned before this RPC. For |
| 37 | +example, a wallet transaction that was BIP-125-replaced in the mempool prior to |
| 38 | +this RPC may not yet be reflected as such in this RPC response. |
0 commit comments