Skip to content

Commit

Permalink
add '&' operator to NotifyBlockTip connectors to fix compilation error:
Browse files Browse the repository at this point in the history
error: invalid ‘static_cast’ from type ‘boost::detail::function::function_buffer_members::obj_ptr_t’ {aka ‘void*’} to type ‘void (*)(bool, const CBlockIndex*)
  • Loading branch information
Naviabheeman authored and azuchi committed Oct 23, 2024
1 parent 2993619 commit 8ce8f12
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1619,13 +1619,13 @@ bool AppInitMain()
// 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() == nullptr) {
uiInterface.NotifyBlockTip.connect(BlockNotifyGenesisWait);
uiInterface.NotifyBlockTip.connect(&BlockNotifyGenesisWait);
} else {
fHaveGenesis = true;
}

if (gArgs.IsArgSet("-blocknotify"))
uiInterface.NotifyBlockTip.connect(BlockNotifyCallback);
uiInterface.NotifyBlockTip.connect(&BlockNotifyCallback);

std::vector<fs::path> vImportFiles;
for (const std::string& strFile : gArgs.GetArgs("-loadblock")) {
Expand All @@ -1643,7 +1643,7 @@ bool AppInitMain()
while (!fHaveGenesis && !ShutdownRequested()) {
condvar_GenesisWait.wait_for(lock, std::chrono::milliseconds(500));
}
uiInterface.NotifyBlockTip.disconnect(BlockNotifyGenesisWait);
uiInterface.NotifyBlockTip.disconnect(&BlockNotifyGenesisWait);
}

if (ShutdownRequested()) {
Expand Down

0 comments on commit 8ce8f12

Please sign in to comment.