Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1UiPN5-0003eP-PD for bitcoin-development@lists.sourceforge.net; Fri, 31 May 2013 13:27:55 +0000 Received-SPF: pass (sog-mx-3.v43.ch3.sourceforge.com: domain of bitpay.com designates 209.85.128.41 as permitted sender) client-ip=209.85.128.41; envelope-from=jgarzik@bitpay.com; helo=mail-qe0-f41.google.com; Received: from mail-qe0-f41.google.com ([209.85.128.41]) by sog-mx-3.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1UiPN4-000750-Um for bitcoin-development@lists.sourceforge.net; Fri, 31 May 2013 13:27:55 +0000 Received: by mail-qe0-f41.google.com with SMTP id b4so900480qen.14 for ; Fri, 31 May 2013 06:27:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding:x-gm-message-state; bh=tRqNwtxbGjQP0oggIkQ1yhhJnjgBeTuSULSzdpvBsd8=; b=F4ZSgkOBaqhelF9XHHoIphV6uFV48lg3QbWDIWQmSM4Px7pVCnS+WOGqTsj6yU4RsT lhbXrscyrQH+4ofxP7LZSA3C1OIIBK2BLLv2sX3cmdetMB4ZiE4mJpKv1vXpa0ACrfhD u7/FAH3ICEq8aQawL34bjnPZdT2Bz0e/VgAZBxoQqhi7SzP64kfs2+laOWQDQb39Ss3X PLodDbtfQj3HcTjGZs0g8zr6NC87QKoXyESEyKHjF0Xvau7GroyBO+cGWlpEin7cMY8Z PH6gNJis2PHhyHF4COFdMmsuTHnAovDGkbWxXRjNnvqRzMt3HYErpYinEFDaqGno7dyn RsIg== MIME-Version: 1.0 X-Received: by 10.49.81.147 with SMTP id a19mr6203642qey.47.1370005554774; Fri, 31 May 2013 06:05:54 -0700 (PDT) Received: by 10.49.2.102 with HTTP; Fri, 31 May 2013 06:05:54 -0700 (PDT) In-Reply-To: References: Date: Fri, 31 May 2013 09:05:54 -0400 Message-ID: From: Jeff Garzik To: =?ISO-8859-1?Q?Rune_Kj=E6r_Svendsen?= Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQmFQjKaWf8agE3HaLmlYPrUMeyxAiyyq8GkGSUs3PZDHkb2hrXj+rd+0v0L1gXywPgVwQTh X-Spam-Score: -1.6 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-Headers-End: 1UiPN4-000750-Um Cc: bitcoin-development@lists.sourceforge.net Subject: Re: [Bitcoin-development] Implementing batch processing for -blocknotify X-BeenThere: bitcoin-development@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 13:27:55 -0000 On Fri, May 31, 2013 at 7:56 AM, Rune Kj=E6r Svendsen = 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 exec= ute > my application for each new block. > > The problem is that my app isn't necessarily quick enough to finish its w= ork > 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 previou= s > 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. --=20 Jeff Garzik Senior Software Engineer and open source evangelist BitPay, Inc. https://bitpay.com/