Moving FeatureSupport() and UserBlockchain.Header() calls out of Message Encoding.

This paves the way for refactoring the message code into the protocol package.
This commit is contained in:
Kleissner
2021-10-17 17:40:22 +02:00
parent 4d3caaf567
commit 1b93eac17a
7 changed files with 27 additions and 23 deletions

View File

@@ -207,7 +207,8 @@ func autoMulticastBroadcast() {
// contactArbitraryPeer contacts a new arbitrary peer for the first time.
func contactArbitraryPeer(publicKey *btcec.PublicKey, address *net.UDPAddr, receiverPortInternal uint16) (contacted bool) {
findSelf := ShouldSendFindSelf()
packets := msgEncodeAnnouncement(true, findSelf, nil, nil, nil)
_, blockchainHeight, blockchainVersion := UserBlockchain.Header()
packets := msgEncodeAnnouncement(true, findSelf, nil, nil, nil, FeatureSupport(), blockchainHeight, blockchainVersion)
if len(packets) == 0 || packets[0].err != nil {
return false
}