Start refactoring protocol code into sub package. Move Packet Encoding and list of Commands. Change SetSelfReportedPorts parameters.

More related commits to follow!
This commit is contained in:
Kleissner
2021-10-17 16:28:19 +02:00
parent 2476146949
commit 0c7b1e0e03
18 changed files with 149 additions and 115 deletions

View File

@@ -20,6 +20,7 @@ import (
"sync"
"time"
"github.com/PeernetOfficial/core/protocol"
"github.com/btcsuite/btcd/btcec"
)
@@ -210,7 +211,7 @@ func contactArbitraryPeer(publicKey *btcec.PublicKey, address *net.UDPAddr, rece
if len(packets) == 0 || packets[0].err != nil {
return false
}
raw := &PacketRaw{Command: CommandAnnouncement, Payload: packets[0].raw}
raw := &protocol.PacketRaw{Command: protocol.CommandAnnouncement, Payload: packets[0].raw}
Filters.MessageOutAnnouncement(publicKey, nil, raw, findSelf, nil, nil, nil)