From 718ceafcef18fbb406f0b01cfb18e22d09a58462 Mon Sep 17 00:00:00 2001 From: qiandongyan Date: Mon, 2 Dec 2024 10:42:41 +0800 Subject: [PATCH] fix compatibility with boost 1.83 [Bugfix] Fix incorrect disconnect call for static functions Problem: When using `uiInterface.NotifyBlockTip.disconnect(BlockNotifyGenesisWait)` to disconnect a static function, the compilation fails because `boost::signals2::disconnect` requires the exact type signature match of the slot. Using the function name directly doesn't resolve to the correct function pointer for static functions. Solution: The fix explicitly uses `&BlockNotifyGenesisWait` to pass the function pointer. This resolves the compilation error. Impact: Only affects the disconnect mechanism for static functions in `uiInterface.NotifyBlockTip`. Signed-off-by: Dongyan Qian --- src/init.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index d6c224a10..94ac81f8b 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1650,7 +1650,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler) // Either install a handler to notify us when genesis activates, or set fHaveGenesis directly. // No locking, as this happens before any background thread is started. if (chainActive.Tip() == NULL) { - uiInterface.NotifyBlockTip.connect(BlockNotifyGenesisWait); + uiInterface.NotifyBlockTip.connect(&BlockNotifyGenesisWait); } else { fHaveGenesis = true; } @@ -1673,7 +1673,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler) while (!fHaveGenesis) { condvar_GenesisWait.wait(lock); } - uiInterface.NotifyBlockTip.disconnect(BlockNotifyGenesisWait); + uiInterface.NotifyBlockTip.disconnect(&BlockNotifyGenesisWait); } // ********************************************************* Step 11: start node