aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
diff options
context:
space:
mode:
authorJonas Schnelli <dev@jonasschnelli.ch>2015-11-26 15:48:26 +0100
committerJonas Schnelli <dev@jonasschnelli.ch>2015-11-30 08:50:59 +0100
commit012fc91511b153ce3fd3e9fb7bbed8f85fb1690e (patch)
tree1360a783f7f2cf341b035822558aa86d705b8335 /src/init.cpp
parent5d5ef3a4cf8e32cdf584811eb5415278f4ba9628 (diff)
downloadbitcoin-012fc91511b153ce3fd3e9fb7bbed8f85fb1690e.tar.xz
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
Diffstat (limited to 'src/init.cpp')
-rw-r--r--src/init.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 1c2f3f49d4..8710e37fed 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -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
}