Push notification of incoming transaction Is there a way to be notified by bitcoind via the CLI that some incoming transaction has been confirmed?
A transaction can only be confirmed by a new block being added to the chain. And since that happens on average every ten minutes, it would work just as well to be notified when a block is discovered (and/or the chain is reorganized). You can then check any transactions you care about.

One way to be notified if the chain is changed in any way is with my native long polling patch. This should apply pretty cleanly to any recent version of the client (but is based on 0.4.0):

diff -u orig/init.cpp new/init.cpp
--- orig/init.cpp   2011-09-25 08:29:53.935505617 -0700
+++ new/init.cpp    2011-09-25 08:48:13.667215990 -0700
@@ -199,6 +200,7 @@
             "  -rpcport=&lt;port&gt;  \t\t  " + _("Listen for JSON-RPC connections on &lt;port&gt; (default: 8332)\n") +
             "  -rpcallowip=&lt;ip&gt; \t\t  " + _("Allow JSON-RPC connections from specified IP address\n") +
             "  -rpcconnect=&lt;ip&gt; \t  "   + _("Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)\n") +
+            "  -pollpidfile=&lt;f&gt; \t  "   + _("Support long polling\n") +
             "  -keypool=&lt;n&gt;     \t  "   + _("Set key pool size to &lt;n&gt; (default: 100)\n") +
             "  -rescan          \t  "   + _("Rescan the block chain for missing wallet transactions\n");

diff -u orig/main.cpp new/main.cpp
--- orig/main.cpp   2011-09-25 08:29:53.937505613 -0700
+++ new/main.cpp    2011-09-25 08:48:13.667215990 -0700
@@ -1118,6 +1118,7 @@
 bool CBlock::SetBestChain(CTxDB&amp; txdb, CBlockIndex* pindexNew)
 {
     uint256 hash = GetHash();
+    bool lp = false;

     txdb.TxnBegin();
     if (pindexGenesisBlock == NULL &amp;&amp; hash == hashGenesisBlock)
@@ -1160,6 +1161,7 @@
     // Update best block in wallet (so we can detect restored wallets)
     if (!IsInitialBlockDownload())
     {
+        lp = true;
         const CBlockLocator locator(pindexNew);
         ::SetBestChain(locator);
     }
@@ -1173,6 +1175,23 @@
     nTransactionsUpdated++;
     printf("SetBestChain: new best=%s  height=%d  work=%s\n", hashBestChain.ToString().substr(0,20).c_str(), nBest

+    if (lp)
+    {
+        // Support long polling
+        string lp_pid = mapArgs["-pollpidfile"];
+        if(lp_pid != "")
+        {
+            FILE *pidFile = fopen(lp_pid.c_str(), "r");
+            if(pidFile!=NULL)
+            {
+                int pid=0;
+                if ((fscanf(pidFile, "%d", &amp;pid) == 1) &amp;&amp; (pid &gt; 1))
+                    kill((pid_t) pid, SIGUSR1);
+                fclose(pidFile);
+            }
+        }
+    }
+
     return true;
 }


To use it, just start bitcoin or bitcoind with a command line argument of-pollpidfile=/path/to/some/file. Then write your monitor process' PID to that file. You will receive a SIGUSR1 on any block chain change.