Skip to content

Commit

Permalink
fix compatibility with boost 1.83
Browse files Browse the repository at this point in the history
[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 <[email protected]>
  • Loading branch information
MarsDoge committed Dec 2, 2024
1 parent e0a8637 commit 718ceaf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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
Expand Down

0 comments on commit 718ceaf

Please sign in to comment.