We have (almost) the same code chunk used twice. Improve that by slight refactoring.
The only behavior change is that the following will be also applied to the first (pre-VERACK) self-announcement:
0// If discovery is enabled, sometimes give our peer the address it
1// tells us that it sees us as in case it has a better idea of our
2// address than we do.
And I think it’s a good change anyway.
The last commit is just to consider the first self-announcement as regular and reset the timer, so that we don’t send the second self-announcement too soon. Note that since the first self-announcement is made at the end of processing VERSION, at that point addrLocal would be already filled with what the peers tells us we are, so this self-announcement would be no worse than any further one.