We should start the self-handshake before the refinery, since it is
higher priority on start(). Also we should first stop the refinery
before saving the hostlist on stop().
Add an additional byte to SessionBitFlags to accommodate SESSION_REFINE
and reduce the risk of logic errors.
Additionally:
* `!SESSION_SEED & !SESSION_REFINE` is now referred to as `SESSION_DEFAULT`
* `!SESSION_REFINE` is refered to as `SESSION_NET`.
* `SESSION_ALL` has been deleted since it was conceptually out-dated
* Binaries have been updated.
Add an additional byte to SessionBitFlags to accommodate SESSION_REFINE
and reduce the risk of logic errors.
Additionally:
* `!SESSION_SEED & !SESSION_REFINE` is now referred to as `SESSION_DEFAULT`
* `!SESSION_REFINE` is refered to as `SESSION_NET`.
* `SESSION_ALL` has been deleted since it was conceptually out-dated
* Binaries have been updated.
1. Settings blacklist is now a Vec<(Url, Vec<u16>)> and if ports are left empty,
we block all the ports of the given host.
2. We read from the settings blacklist on RefineSession::start(), and
also move other save() and load() host functions into refine session
since it's more logical than doing in GreylistRefinery.
3. Last but not least, we fix a really BAD BUG which would send blacklist peers to the Gold list instead of Black list when blacklisting peers in move_host() !!!
Modifications to the greylist (appending or deleting from) are dangerous while the refinery is ongoing, since it can lead to panics in the case the refinery fails (because we delete from the greylist by index when that happens).
We mitigate this issue by acquiring an exclusive lock on the greylist before proceeding with the refinery, and dropping the lock once the refinery process has finished and greylist modifications are no longer dangerous.
Modifications to the greylist (appending or deleting from) are dangerous while the refinery is ongoing, since it can lead to panics in the case the refinery fails (because we delete from the greylist by index when that happens).
We mitigate this issue by acquiring an exclusive lock on the greylist before proceeding with the refinery, and dropping the lock once the refinery process has finished and greylist modifications are no longer dangerous.