node: fix a bug where nil is recorded as node's address#3740
Merged
node: fix a bug where nil is recorded as node's address#3740
nil is recorded as node's address#3740Conversation
Solution AddOurAddress when we know it sw.NetAddress is nil in createAddrBookAndSetOnSwitch it's set by n.transport.Listen function, which is called during start Fixes #3716
9c6a03f to
a6f59f8
Compare
jackzampolin
approved these changes
Jun 20, 2019
alexanderbez
approved these changes
Jun 20, 2019
Codecov Report
@@ Coverage Diff @@
## develop #3740 +/- ##
===========================================
+ Coverage 63.92% 63.93% +<.01%
===========================================
Files 241 241
Lines 19984 19981 -3
===========================================
Hits 12774 12774
+ Misses 6167 6165 -2
+ Partials 1043 1042 -1
|
melekes
commented
Jun 20, 2019
| addrBook.SetLogger(p2pLogger.With("book", config.P2P.AddrBookFile())) | ||
|
|
||
| // Add ourselves to addrbook to prevent dialing ourselves | ||
| addrBook.AddOurAddress(sw.NetAddress()) |
Contributor
Author
There was a problem hiding this comment.
sw.NetAddress is nil at this point. It's populated by transport#Listen, which is called during node#OnStart
unclezoro
pushed a commit
to unclezoro/tendermint
that referenced
this pull request
Sep 6, 2019
…#3740) * node: fix a bug where `nil` is recorded as node's address Solution AddOurAddress when we know it sw.NetAddress is nil in createAddrBookAndSetOnSwitch it's set by n.transport.Listen function, which is called during start Fixes tendermint#3716 * use addr instead of n.sw.NetAddress * add both ExternalAddress and ListenAddress as our addresses
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Solution
AddOurAddresswhen we know itsw.NetAddressisnilincreateAddrBookAndSetOnSwitchit's set by
n.transport.Listenfunction, which is called during startFixes #3716
Updated all relevant documentation in docs