bitcoin/src/interfaces
ismaelsadeeq 1b41d45d46
wallet: bugfix: ensure atomicity in settings updates
- Settings updates were not thread-safe, as they were executed in
  three separate steps:

  1) Obtain settings value while acquiring the settings lock.
  2) Modify settings value.
  3) Overwrite settings value while acquiring the settings lock.

  This approach allowed concurrent threads to modify the same base value
  simultaneously, leading to data loss. When this occurred, the final
  settings state would only reflect the changes from the last thread
  that completed the operation, overwriting updates from other threads.

  Fix this by making the settings update operation atomic.

- Add test coverage for this behavior.

Co-authored-by: furszy <matiasfurszyfer@protonmail.com>
2024-08-26 13:41:56 +01:00
..
chain.h wallet: bugfix: ensure atomicity in settings updates 2024-08-26 13:41:56 +01:00
echo.h tidy: modernize-use-equals-default 2024-07-08 11:12:01 +02:00
handler.h tidy: modernize-use-equals-default 2024-07-08 11:12:01 +02:00
init.h Introduce Mining interface 2024-06-18 18:47:51 +02:00
ipc.h Add ipc::Context and ipc::capnp::Context structs 2021-06-10 09:58:45 -05:00
mining.h refactor: pass BlockCreateOptions to createNewBlock 2024-07-16 10:27:57 +02:00
node.h Merge bitcoin-core/gui#626: Showing Local Addresses in Node Window 2024-08-02 14:19:02 +01:00
README.md multiprocess: Add comments and documentation 2021-04-23 03:02:50 -05:00
wallet.h gui: Use wallet name for wallet migration rather than WalletModel 2024-08-13 11:25:38 -04:00

Internal c++ interfaces

The following interfaces are defined here:

  • Chain — used by wallet to access blockchain and mempool state. Added in #14437, #14711, #15288, and #10973.

  • ChainClient — used by node to start & stop Chain clients. Added in #14437.

  • Node — used by GUI to start & stop bitcoin node. Added in #10244.

  • Wallet — used by GUI to access wallets. Added in #10244.

  • Handler — returned by handleEvent methods on interfaces above and used to manage lifetimes of event handlers.

  • Init — used by multiprocess code to access interfaces above on startup. Added in #19160.

  • Ipc — used by multiprocess code to access Init interface across processes. Added in #19160.

The interfaces above define boundaries between major components of bitcoin code (node, wallet, and gui), making it possible for them to run in different processes, and be tested, developed, and understood independently. These interfaces are not currently designed to be stable or to be used externally.