mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 22:18:54 +01:00
Merge bitcoin/bitcoin#26298: refactor: Move src/interfaces/*.cpp files to libbitcoin_common.a
b19c4124b3refactor: Rename ambiguous interfaces::MakeHandler functions (Ryan Ofsky)dd6e8bd71cbuild: remove BOOST_CPPFLAGS from libbitcoin_util (fanquake)82e272a109refactor: Move src/interfaces/*.cpp files to libbitcoin_common.a (Ryan Ofsky) Pull request description: These belong in `libbitcoin_common.a`, not `libbitcoin_util.a`, because they aren't general-purpose utilities, they just contain some common glue code that is used by both the node and the wallet. Another reason not to include these in `libbitcoin_util.a` is to prevent them from being used by the kernel library. Also rename ambiguous `MakeHandler` functions to `MakeCleanupHandler` and `MakeSignalHandler`. Cleanup function handler was introduced after boost signals handler, so original naming didn't make much sense. This just contains a move-only commit, and a rename commit. There are no actual code or behavior changes. This PR is an alternative to #26293, and solves the same issue of removing a boost dependency from the _util_ library. The advantages of this PR compared to #26293 are that it keeps the source directory structure more flat, and it avoids having to change #includes all over the codebase. ACKs for top commit: hebasto: ACKb19c4124b3Tree-SHA512: b3a1d33eedceda7ad852c6d6f35700159d156d96071e59acae2bc325467fef81476f860a8855ea39cf3ea706a1df2a341f34fb2dcb032c31a3b0e9cf14103b6a
This commit is contained in:
@@ -64,7 +64,7 @@ using interfaces::BlockTip;
|
||||
using interfaces::Chain;
|
||||
using interfaces::FoundBlock;
|
||||
using interfaces::Handler;
|
||||
using interfaces::MakeHandler;
|
||||
using interfaces::MakeSignalHandler;
|
||||
using interfaces::Node;
|
||||
using interfaces::WalletLoader;
|
||||
|
||||
@@ -336,50 +336,50 @@ public:
|
||||
}
|
||||
std::unique_ptr<Handler> handleInitMessage(InitMessageFn fn) override
|
||||
{
|
||||
return MakeHandler(::uiInterface.InitMessage_connect(fn));
|
||||
return MakeSignalHandler(::uiInterface.InitMessage_connect(fn));
|
||||
}
|
||||
std::unique_ptr<Handler> handleMessageBox(MessageBoxFn fn) override
|
||||
{
|
||||
return MakeHandler(::uiInterface.ThreadSafeMessageBox_connect(fn));
|
||||
return MakeSignalHandler(::uiInterface.ThreadSafeMessageBox_connect(fn));
|
||||
}
|
||||
std::unique_ptr<Handler> handleQuestion(QuestionFn fn) override
|
||||
{
|
||||
return MakeHandler(::uiInterface.ThreadSafeQuestion_connect(fn));
|
||||
return MakeSignalHandler(::uiInterface.ThreadSafeQuestion_connect(fn));
|
||||
}
|
||||
std::unique_ptr<Handler> handleShowProgress(ShowProgressFn fn) override
|
||||
{
|
||||
return MakeHandler(::uiInterface.ShowProgress_connect(fn));
|
||||
return MakeSignalHandler(::uiInterface.ShowProgress_connect(fn));
|
||||
}
|
||||
std::unique_ptr<Handler> handleInitWallet(InitWalletFn fn) override
|
||||
{
|
||||
return MakeHandler(::uiInterface.InitWallet_connect(fn));
|
||||
return MakeSignalHandler(::uiInterface.InitWallet_connect(fn));
|
||||
}
|
||||
std::unique_ptr<Handler> handleNotifyNumConnectionsChanged(NotifyNumConnectionsChangedFn fn) override
|
||||
{
|
||||
return MakeHandler(::uiInterface.NotifyNumConnectionsChanged_connect(fn));
|
||||
return MakeSignalHandler(::uiInterface.NotifyNumConnectionsChanged_connect(fn));
|
||||
}
|
||||
std::unique_ptr<Handler> handleNotifyNetworkActiveChanged(NotifyNetworkActiveChangedFn fn) override
|
||||
{
|
||||
return MakeHandler(::uiInterface.NotifyNetworkActiveChanged_connect(fn));
|
||||
return MakeSignalHandler(::uiInterface.NotifyNetworkActiveChanged_connect(fn));
|
||||
}
|
||||
std::unique_ptr<Handler> handleNotifyAlertChanged(NotifyAlertChangedFn fn) override
|
||||
{
|
||||
return MakeHandler(::uiInterface.NotifyAlertChanged_connect(fn));
|
||||
return MakeSignalHandler(::uiInterface.NotifyAlertChanged_connect(fn));
|
||||
}
|
||||
std::unique_ptr<Handler> handleBannedListChanged(BannedListChangedFn fn) override
|
||||
{
|
||||
return MakeHandler(::uiInterface.BannedListChanged_connect(fn));
|
||||
return MakeSignalHandler(::uiInterface.BannedListChanged_connect(fn));
|
||||
}
|
||||
std::unique_ptr<Handler> handleNotifyBlockTip(NotifyBlockTipFn fn) override
|
||||
{
|
||||
return MakeHandler(::uiInterface.NotifyBlockTip_connect([fn](SynchronizationState sync_state, const CBlockIndex* block) {
|
||||
return MakeSignalHandler(::uiInterface.NotifyBlockTip_connect([fn](SynchronizationState sync_state, const CBlockIndex* block) {
|
||||
fn(sync_state, BlockTip{block->nHeight, block->GetBlockTime(), block->GetBlockHash()},
|
||||
GuessVerificationProgress(Params().TxData(), block));
|
||||
}));
|
||||
}
|
||||
std::unique_ptr<Handler> handleNotifyHeaderTip(NotifyHeaderTipFn fn) override
|
||||
{
|
||||
return MakeHandler(
|
||||
return MakeSignalHandler(
|
||||
::uiInterface.NotifyHeaderTip_connect([fn](SynchronizationState sync_state, int64_t height, int64_t timestamp, bool presync) {
|
||||
fn(sync_state, BlockTip{(int)height, timestamp, uint256{}}, presync);
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user