I really like this PR, but it wound up being pretty nontrivial to merge. The crux is that it pulls PSBT signing logic into scriptpubkey manager, which is where it belongs, but for us this means reasoning about pegins inside script/sign.cpp. However, sign.cpp is part of libbitcoin_common, which does not include anything for reasoning about PoW or RPC (lol) or anything heavy about that. This means that some pegin validation had to remain split between the wallet/rpc layer and sign.cpp. I added a new file script/pegins.cpp which has the (one) method we actually need in sign.cpp. Aside from that, this diff is very large but is mostly just moving our code changes to wallet/psbtwallet.* into wallet/wallet.* where those functions now live. As far as review, it's probably not worthwhile to spend too much too much time on this since it's going to be change again in #16528 and others. The test coverage is pretty extensive. |
||
|---|---|---|
| .. | ||
| chain.cpp | ||
| chain.h | ||
| handler.cpp | ||
| handler.h | ||
| node.cpp | ||
| node.h | ||
| README.md | ||
| wallet.cpp | ||
| wallet.h | ||
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 & stopChainclients. Added in #14437. -
Node— used by GUI to start & stop bitcoin node. Added in #10244. -
Handler— returned byhandleEventmethods 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.