Long polling

From Bitcoin Wiki
(Redirected from Long Polling)
Jump to navigation Jump to search

Long polling is a method used by some Bitcoin pools by which notifications are sent to all miners when a valid block has been generated and added to the blockchain. This serves the purpose of stopping work on the old block and beginning to work on a fresh block, thus reducing the production of stale shares.

Without long polling, if a miner was in the middle of an assigned workload when a new block was discovered by someone else, it would continue working on the old obsolete block solution until it was finished - thus wasting effort.

In getblocktemplate

BIP 22 defines long polling as an optional part of getblocktemplate. A server that supports it puts a longpollid in each block template, and may give a separate address for long poll requests in longpolluri. The miner sends a new request with that longpollid and a very long timeout. The server answers only when it wants to replace the current block data. When the answer comes, the miner starts work on the new template and sends the next long poll request.[1]

See also

References