Antoine Poinsot 9bb20303e7
Merge #63: Chain reorganization handling
e75637d3629df901b1aa453b131c1c780bfd8724 jsonrpc: fixup two typos in error messages (Antoine Poinsot)
a9b0e5e559b0ddddbd8e612771a95182f131e0f0 qa: functional tests for block chain reorganization (Antoine Poinsot)
e88bbbe65b34cf7af645fc3f07a90266d4a66792 poller: block chain reorganization handling (Antoine Poinsot)
d6f24e1c6a20d961128aa9c95367bd62aa8cb229 bitcoind: don't return spent coins with unfetchable spending tx as spent (Antoine Poinsot)
99ab0d7add5f9f3f924a6bd61263135c09e2a4cc commands: add a 'spend_info' field to the 'listcoins' entries (Antoine Poinsot)
57add1d86bb734b0f5291b2f266ef5652c93bc8d commands: return the DB's block height in 'getinfo' (Antoine Poinsot)
92f7ef12251309a30d100108ad82cd6790b5f4ac commands: make listcoins return all coins by default (Antoine Poinsot)
e9e4acd69de55e0c32c7e275e3b5318b5e161c46 db: database interface to rollback to a previous best block (Antoine Poinsot)
972c8dac86976723f4c417142999d4850c2fb9b6 db: require the spend block height from the DB interface (Antoine Poinsot)
6038843d33621c098d958d343c8b6d038922f72f database: rename coins' spent_at in spend_block_time (Antoine Poinsot)
cce227f80fbcbb32c5fca6fe78142131d7f35a53 bitcoin: interface to get the common block in our and the backend's chains (Antoine Poinsot)

Pull request description:

  This finally implements our reorganization handling. Like in revaultd, upon noticing a tip change that indicates a reorg happened in our Bitcoin backend we rollback our state to the common ancestor between our state and the new chain, then start rescanning from there. The logic is much more straightforward than in revaultd though, as there is no presigned transactions to care about.

  The PR grew a bit large as this needed a bit of preparatory work in order to be reasonably tested (and i noticed a few bugs and cleanups that slipped through review in #29). Please let me know if reviewers prefer that i split the prep work on the commands in another PR.

  Fixes #15.

ACKs for top commit:
  darosior:
    ACK e75637d3629df901b1aa453b131c1c780bfd8724

Tree-SHA512: 1ebb2a3e10b462b739e1d5cb831de946177436c8fad4dcb20eb575fd0f58bef98a86e25c5fe0ed07d946975f982a420940607a69e74f24a02ef16271c92eceba
2022-10-18 19:44:56 +02:00
2022-10-13 14:24:25 +02:00
2022-08-22 17:19:08 +02:00
2022-07-20 16:17:32 +02:00
Description
A fork of https://github.com/wizardsardine/liana with removed loopback restrictions to allow connecting to a custom remote bitcoin core node
Languages
Rust 90.4%
Python 8.5%
Shell 0.5%
Scheme 0.3%
Nix 0.3%