What is Nostr?
Jeff Garzik [ARCHIVE] /
npub1kf0…3f58
2023-06-07 15:02:34
in reply to nevent1q…grcq

Jeff Garzik [ARCHIVE] on Nostr: 📅 Original date posted:2013-05-31 📝 Original message:On Fri, May 31, 2013 at ...

📅 Original date posted:2013-05-31
📝 Original message:On Fri, May 31, 2013 at 7:56 AM, Rune Kjær Svendsen <runesvend at gmail.com> wrote:
> Hello dear list
>
> I have an application that wants to keep up with new blocks as they come in.
> For that I can use the -blocknotify option with bitcoind, which will execute
> my application for each new block.
>
> The problem is that my app isn't necessarily quick enough to finish its work
> before a new block comes in and the app is executed again. This means the
> that bitcoind might keep executing my application even though the previous
> instance hasn't finished, and that's fairly inefficient resource-wise, as
> many instances of the application will be running simultaneously.
>
> I've discussed this with wumpus on bitcoin-dev, and we figured out a
> solution that might be better. It could replace -blocknotify or we could put
> it in a new function called -batchblocknotify

Similar to other suggestions in this thread,

If your -blocknotify execution is too slow, then create a solution
that simply queues work. There is no need to add this code to
bitcoind itself.

Another solution is modifying pynode to directly listen to a trusted
node (bitcoind), and monitor blocks as they arrive and are announced.
That does not fix the problem of slow block processing on your side,
but is another way to implement -blocknotify-like behavior.

--
Jeff Garzik
Senior Software Engineer and open source evangelist
BitPay, Inc. https://bitpay.com/
Author Public Key
npub1kf0ppcjaguxekg24yx6smgxlu73qn0k8lm0t2wrqc0scpl7u3sgsmf3f58