bitcoin/src/interfaces
Antoine Riard f77b1de16f Only return early from BlockUntilSyncedToCurrentChain if current tip
is exact match

In the next commit, we start using BlockConnected/BlockDisconnected
callbacks to establish tx depth, rather than querying the chain
directly.

Currently, BlockUntilSyncedToCurrentChain will return early if
the best block processed by the wallet is a descendant of the node'tip.
That means that in the case of a re-org, it won't wait for the
BlockDisconnected callbacks that have been enqueued during the re-org
but have not yet been triggered in the wallet.

Change BlockUntilSyncedToCurrentChain to only return early if the
wallet's m_last_block_processed matches the tip exactly. This ensures
that there are no BlockDisconnected or BlockConnected callbacks
in-flight.
2019-11-06 13:36:43 -05:00
..
README.md
chain.cpp Only return early from BlockUntilSyncedToCurrentChain if current tip 2019-11-06 13:36:43 -05:00
chain.h Only return early from BlockUntilSyncedToCurrentChain if current tip 2019-11-06 13:36:43 -05:00
handler.cpp
handler.h
node.cpp scripted-diff: Remove g_connman, g_banman globals 2019-10-28 10:30:51 -04:00
node.h Merge #17297: refactor: Remove addrdb.h dependency from node.h 2019-11-04 13:18:27 +01:00
wallet.cpp Merge #16839: Replace Connman and BanMan globals with NodeContext local 2019-10-30 12:35:41 +01:00
wallet.h [wallet] Remove return value from CommitTransaction() 2019-10-18 09:26:32 -04:00

README.md

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 #10102.

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.