Browse Source

p2p: set MConnection#created during init (#2990)

Fixes #2715

In crawlPeersRoutine, which is performed when seedMode is run, there is
logic that disconnects the peer's state information at 3-hour intervals
through the duration value. The duration value is calculated by
referring to the created value of MConnection. When MConnection is
created for the first time, the created value is not initiated, so it is
not disconnected every 3 hours but every time it is disconnected. So,
normal nodes are connected to seedNode and disconnected immediately, so
address exchange does not work properly.

https://github.com/tendermint/tendermint/blob/master/p2p/pex/pex_reactor.go#L629
This point is not work correctly.
I think,
https://github.com/tendermint/tendermint/blob/master/p2p/conn/connection.go#L148
created variable is missing the current time setting.
pull/2999/head
Anton Kaliaev 6 years ago
committed by Ethan Buchman
parent
commit
f69e2c6d6c
2 changed files with 3 additions and 1 deletions
  1. +2
    -1
      CHANGELOG_PENDING.md
  2. +1
    -0
      p2p/conn/connection.go

+ 2
- 1
CHANGELOG_PENDING.md View File

@ -21,4 +21,5 @@ Special thanks to external contributors on this release:
### IMPROVEMENTS:
### BUG FIXES:
- [kv indexer] \#2912 don't ignore key when executing CONTAINS
- [kv indexer] \#2912 don't ignore key when executing CONTAINS
- [p2p] \#2715 fix a bug where seeds don't disconnect from a peer after 3h

+ 1
- 0
p2p/conn/connection.go View File

@ -160,6 +160,7 @@ func NewMConnectionWithConfig(conn net.Conn, chDescs []*ChannelDescriptor, onRec
onReceive: onReceive,
onError: onError,
config: config,
created: time.Now(),
}
// Create channels


Loading…
Cancel
Save