[census] delete imported census once they are not required anymore
When a process is over, wait some blocks and then remove the imported census in order to save disk space.
A new flag must be introduced --keepAllCensus
to disable this mechanism
There are two types of census:
- local census: the name is something like
<pubKey>/<arbitrary_censusId>
- imported census: the name is just (32 bytes hexString)
While the local census are created via the Websockets API by an authorized client, the imported ones are created by the import census
daemon, which reads the Ethereum events in order to detect new voting processes and its census.
The local census might be kept forever but the imported ones should be pruned once the voting process is finished.
In order to keep track of the current on-going processes, two mechanisms might be used (one or the other):
- use the scrutinizer
- write a new vochain/Event handler in order to detect when a process is over (subscribing to onCancel() and scheduling the end block number with onProcess())
Edited by Daniel Martí