5

My node is way behind and I noticed the -blocknoitfy action specified in bitcoin.conf is not being triggered. Which is OK for now, because the node has so much catching up to do, the script wouldn't do any good anyway.

Is this correct behavior? At what point does blocknotify start triggering again? My experience is that after a few hours or even a day of downtime, it gets triggered for every block during catch-up (so it could be a dozen triggers all at once, for example)

6

Yes, this is by design.

The notify action is run in the function BlockNotifyCallback (init.cpp), and you can see:

static void BlockNotifyCallback(bool initialSync, const CBlockIndex *pBlockIndex)
{
    if (initialSync || !pBlockIndex)
        return;
    // ...
}

The initialSync argument comes from the return value of IsInitialBlockDownload() (in validate.cpp). It checks several things to determine if the initial block download is ongoing. Probably the operative one here is a check whether the most recent known block has a timestamp that is more than 24 hours earlier than the current system time.

So it appears you will start getting notifications when you are 24 hours behind or less.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.