NotifyBlockTip signal: switch from hash (uint256) to CBlockIndex*
- also adds a boolean for indication if the tip update was happening during initial sync - emit notification also during initial sync
This commit is contained in:
@@ -515,11 +515,14 @@ std::string LicenseInfo()
|
||||
"\n";
|
||||
}
|
||||
|
||||
static void BlockNotifyCallback(const uint256& hashNewTip)
|
||||
static void BlockNotifyCallback(bool initialSync, const CBlockIndex *pBlockIndex)
|
||||
{
|
||||
if (initialSync || !pBlockIndex)
|
||||
return;
|
||||
|
||||
std::string strCmd = GetArg("-blocknotify", "");
|
||||
|
||||
boost::replace_all(strCmd, "%s", hashNewTip.GetHex());
|
||||
boost::replace_all(strCmd, "%s", pBlockIndex->GetBlockHash().GetHex());
|
||||
boost::thread t(runCommand, strCmd); // thread runs free
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user