MultiChain / multichain

Source code for multichaind, multichain-cli and multichain-util.
GNU General Public License v3.0
536 stars 259 forks source link

Wishlist: RPC call to wait #130

Open phmarek opened 3 years ago

phmarek commented 3 years ago

There's an argument -blocknotify for ´multichaind` to call some external program when a new block has been mined. This is great!

For some use cases it would be easier to get notified via an RPC call; the easiest way I can think of is some blocknotify RPC call that just pushes the (still open) socket onto a to-be-notified list, and this list of FDs gets close()d when a new block is available. (Nearly no memory or other overhead.)

Of course, a few other features might be nice - like a timeout argument, or preferences whether to wake up only for a new block or for a new transaction (unconfirmed), etc. - but just having a wakeup via the same channel that the blockchain gets controlled with would be very nice.

Thanks a lot!