- the object also manages unflushed history
- the history DB has its own version, starting at 0
This is the first step to making history management into
a separate service and to larger block sizes.
The next step is an improved history format, which I hope will both
save space and be a solution to issue #185. The DB should be able to
upgrade in-place without re-syncing the chain.
- mempool informed of new block; it notifies controller synchronously
- controller notifies sessions synchronously
- sessions are notified of new height synchronously. Any address touch
notifications are returned to the controller and scheduled
asynchronously.
Also, remove a redundant notification of height on initial header
subscriptions - the subscription response gives the current height;
we also used to send a notification as we didn't update our idea
of notified height.
Fixes the issue whereby notifications weren't sent as long as new blocks
kept coming in. Now a new height notification, with an appropriate mempool
update, is sent after each batch of blocks is processed.
So that the main block processor future is cancellable.
We wait for the executor and then flush anything unflushed.
Resolves the rest of the second part of #100
Apart from the flush on shutdown and the flush when caught up,
neither of which matter, this makes flushes asynchronous.
Also, block processing for reorgs is now asynchronous.
This also removes the FORCE_REORG debug envvar; I want to
put that into the RPC interface.
Closes#102
tx_hash needs to be that of the prior serialization, so
need to change internal read_block API.
Bitcoin core 0.13.1 broke backwards compat of the RPC interface.
Closes#92
It's less awkward and more explicit.
This brings back the efficiency lost in the 0.9.x series.
It also removes the special case hack: both when syncing and
caught up, block processing is done in the executor.
Fixes#58
Cleanup and simplify touched handling and its event, which is
now controlled and owned by the mempool.
The daemon object owns the set of current mempool hashes.
Clean up and simplify the mempool main loop.
Fixes#70.
When the number of sessions reaches MAX_SESSIONS, which defaults
to 1,000, turn off TCP and SSL listening sockets to prevent new
connections. When the session count falls below a low watermark,
currently 90% of MAX_SESSIONS, the listening sockets will be re-opened.
Helps prevent DoS and limit open file usage.
Bug fix: do not start serving paused connections until the buffer
socket is sufficiently drained. Also, loop.