I was planning on creating SQLite triggers, that sounded easier. However, this is much better, I <3 REST. I'm guessing you just pass a URI as part of the original call?domob wrote: I added a hook that gets called whenever the best chain's head changes, and using boost::condition_variable's waiting threads can get notified about this to process the change. I also implemented "asynchronous" RPC routines that spawn a new thread for their processing, so that they can block until the hook triggers and don't halt the whole RPC server (other RPC calls are possible in the mean time and also an arbitrary number of such waiting calls can co-exist).
Seriously: scraping is a shitty hack that breaks easily and takes forever to get just right, esp. with JS. Bitcoin internally might not need more than very basic key->value store, but all of the applications have a need for it.See my pull request at https://github.com/chronokings/huntercoin/pull/11. I also believe this could be a useful addition for Namecoin and Bitcoin in general, particularly for things like your CouchDB application or front-ends in general.
I poked around in the code and I saw references to LevelDB, is it using both SQLite and LevelDB? The reason I mentioned Pouch was because they maintain indexes on top of LevelDB and the PouchDB people thought it would be a fairly straight-forward port if I wanted to use it as LevelDB abstraction layer. However, there seems to be plenty of generic abstractions being created for LevelDB....