Alexander Chepurnoy
Alexander Chepurnoy
* Unused createTempFile removed * remove() is simplified by using JDK8 API * exceptions intercepted in remove()
To randomize connections, we need to evict a random peer periodically (e.g. every few hours) like it is done in Bitcoin
Currently we're choosing peer to connect at random, which is likely vulnerable to eclipsing. Bitcoin is trying to get connections randomly across IP address space, there were some vulnerabilities found...
LRUCache contains a magic number constant: private val cleaningThreshold = 50 Is it reasonable to externalize it into a config?
Findbugs tool (running via "sbt findbugs") is finding a couple of high-priority warnings and a lot of medium-priority warnings. We need to fix them (most of claims are definitely reasonable)....
For now, we have the single constant for maximum number of connections. Split it to set incoming / outgoing connections max number in settings (like in Bitcoin core ref. impl.)
This PR is proposing an alternative difficulty adjustment algorithm and an activation method for it.