bitcoin/bitcoin — pull request #2834 by luke-jr (2013-07-17 02:24:08+00:00)
Title: getblocktemplate: longpolling support

Resubmission of #1355, since GitHub closed it on me.

I have rebased it and addressed both of @jeremysawicki's concerns:
- Shutdown now disconnects all longpoll sessions with an error.
- Longpolling now mimicks the behaviour of BitcoinMiner by returning a new template after a minute has passed and there are new transactions.

These changes were not exactly trivial, so re-review of the code is probably necessary.