Opened 8 years ago
Closed 8 years ago
#2925 closed bug (Invalid)
Wrong peer_id after upgrade
Reported by: | Len Sorensen | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | not applicable |
Component: | libtorrent | Version: | 1.3.13 |
Keywords: | Cc: |
Description
I upgraded from 1.3.12 to 1.3.13 and found out that the peerid being set was still for 1.3.12 (-DE13C0-) rather than 1.3.13 (-DE13D0-). I tracked down why this happened and the fix is simple.
Attachments (1)
Change History (8)
by , 8 years ago
Attachment: | deluge.patch added |
---|
comment:1 by , 8 years ago
So the problem simply is that the peer_id is generated before the session.state is loaded, which then replaces the peer_id with the old one from the saved session.state, which in my case was from 1.3.12, and then continued to set the user agent to 1.3.13, which then causes some picky trackers to point out that the peer_id and user agent are not in agreement.
Moving the session.state loading just before the peer_id is created solves the problem. Not sure why it is ever saved in the session.state in the first place, unless it is to allow a client to adapt an older saved session on load if going to a new format in a new client version.
comment:2 by , 8 years ago
Component: | Unknown → Core |
---|---|
Milestone: | needs verified → 1.3.14 |
Version: | other (please specify) → 1.3.13 |
comment:5 by , 8 years ago
It certainly did seem wrong to generate a peer_id and then overwrite it by loading the saved state immediately afterwards.
comment:6 by , 8 years ago
Component: | Core → libtorrent |
---|
There are some substantial change to session settings in 1.1 and this is a by-product of that. There is a new peer_fingerprint setting and it is now stored in session.state so obviously the fingerprint is overwritten upon loading.
Unfortunately your fix is not correct, since it will never load the previous session state.
I have opened an upstream libtorrent ticket:
comment:7 by , 8 years ago
Milestone: | 1.3.14 → not applicable |
---|---|
Resolution: | → Invalid |
Status: | new → closed |
This will be fixed in next libtorrent release.
Patch to fix peer_id when upgrading