mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
Merge pull request #4599
This commit is contained in:
11
src/init.cpp
11
src/init.cpp
@@ -369,6 +369,14 @@ std::string LicenseInfo()
|
||||
"\n";
|
||||
}
|
||||
|
||||
static void BlockNotifyCallback(const uint256& hashNewTip)
|
||||
{
|
||||
std::string strCmd = GetArg("-blocknotify", "");
|
||||
|
||||
boost::replace_all(strCmd, "%s", hashNewTip.GetHex());
|
||||
boost::thread t(runCommand, strCmd); // thread runs free
|
||||
}
|
||||
|
||||
struct CImportingNow
|
||||
{
|
||||
CImportingNow() {
|
||||
@@ -1185,6 +1193,9 @@ bool AppInit2(boost::thread_group& threadGroup)
|
||||
#endif // !ENABLE_WALLET
|
||||
// ********************************************************* Step 9: import blocks
|
||||
|
||||
if (mapArgs.count("-blocknotify"))
|
||||
uiInterface.NotifyBlockTip.connect(BlockNotifyCallback);
|
||||
|
||||
// scan for better chains in the block chain database, that are not yet connected in the active best chain
|
||||
CValidationState state;
|
||||
if (!ActivateBestChain(state))
|
||||
|
||||
Reference in New Issue
Block a user