Pull request for code reviewing :
If we follow the state of peerEntityOld
:
thePeer
When we found a peer, we compare the blockstamp and updates peerEntityOld
to thePeer
values only if it is more recent.
But when we update peerEntityOld
, the blockstamp
field is not updated ! Thus, the peerEntity
objects gets corrupted with 2 different data :
peerEntity.block
is the most recent, from thePeer.block
peerEntity.raw
is the older data, from peerEntityOld.getRaw()
And peerEntity gets saved in database...
PS : If there is a part of the code which you would like to clean, I would start with this PeeringService code, it's pretty hard to follow the states of the different variables other here ^^