[fix]#1029 blockstamp in raw documents incoherence
Pull request for code reviewing :
If we follow the state of peerEntityOld
:
- if we found a peer in database, it is built from it
- if we didn't found a peer, it is built from received peer
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, fromthePeer.block
-
peerEntity.raw
is the older data, frompeerEntityOld.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 ^^
Merge request reports
Activity
Filter activity
Yes, it is probably the weirdest part of Duniter code. It is also a very old one.
I've created #1050 for this.
Please register or sign in to reply