mirror of
https://github.com/PeernetOfficial/core.git
synced 2026-07-17 02:47:51 +01:00
Prepare refactoring of sequence code
This commit is contained in:
@@ -15,7 +15,7 @@ import (
|
||||
|
||||
// pingConnection sends a ping to the target peer via the specified connection
|
||||
func (peer *PeerInfo) pingConnection(connection *Connection) {
|
||||
raw := &protocol.PacketRaw{Command: protocol.CommandPing, Sequence: msgNewSequence(peer.PublicKey, &peer.messageSequence, nil).sequence}
|
||||
raw := &protocol.PacketRaw{Command: protocol.CommandPing, Sequence: NewSequence(peer.PublicKey, &peer.messageSequence, nil).SequenceNumber}
|
||||
Filters.MessageOutPing(peer, raw, connection)
|
||||
|
||||
err := peer.sendConnection(raw, connection)
|
||||
@@ -37,8 +37,7 @@ func (peer *PeerInfo) sendAnnouncement(sendUA, findSelf bool, findPeer []KeyHash
|
||||
packets := EncodeAnnouncement(sendUA, findSelf, findPeer, findValue, files, FeatureSupport(), blockchainHeight, blockchainVersion)
|
||||
|
||||
for _, packet := range packets {
|
||||
sequence := msgNewSequence(peer.PublicKey, &peer.messageSequence, sequenceData)
|
||||
raw := &protocol.PacketRaw{Command: protocol.CommandAnnouncement, Payload: packet, Sequence: sequence.sequence}
|
||||
raw := &protocol.PacketRaw{Command: protocol.CommandAnnouncement, Payload: packet, Sequence: NewSequence(peer.PublicKey, &peer.messageSequence, sequenceData).SequenceNumber}
|
||||
Filters.MessageOutAnnouncement(peer.PublicKey, peer, raw, findSelf, findPeer, findValue, files)
|
||||
peer.send(raw)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user