| 550 | } |
| 551 | |
| 552 | static void BlockNotifyCallback(bool initialSync, const CBlockIndex *pBlockIndex) |
| 553 | { |
| 554 | if (initialSync || !pBlockIndex) |
| 555 | return; |
| 556 | |
| 557 | std::string strCmd = gArgs.GetArg("-blocknotify", ""); |
| 558 | if (!strCmd.empty()) { |
| 559 | boost::replace_all(strCmd, "%s", pBlockIndex->GetBlockHash().GetHex()); |
| 560 | std::thread t(runCommand, strCmd); |
| 561 | t.detach(); // thread runs free |
| 562 | } |
| 563 | } |
| 564 | |
| 565 | static bool fHaveGenesis = false; |
| 566 | static CWaitableCriticalSection cs_GenesisWait; |
nothing calls this directly
no test coverage detected