mirror of
https://github.com/logos-messaging/go-libp2p-pubsub.git
synced 2026-05-04 07:53:22 +00:00
more logical code ordering
This commit is contained in:
parent
ca6778bc83
commit
5fa0f9ed6a
18
score.go
18
score.go
@ -367,6 +367,15 @@ func (ps *peerScore) Prune(p peer.ID, topic string) {
|
|||||||
tstats.inMesh = false
|
tstats.inMesh = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (ps *peerScore) ValidateMessage(msg *Message) {
|
||||||
|
ps.Lock()
|
||||||
|
defer ps.Unlock()
|
||||||
|
|
||||||
|
// the pubsub subsystem is beginning validation; create a record to track time in
|
||||||
|
// the validation pipeline with an accurate firstSeen time.
|
||||||
|
_ = ps.deliveries.getRecord(ps.msgID(msg.Message))
|
||||||
|
}
|
||||||
|
|
||||||
func (ps *peerScore) DeliverMessage(msg *Message) {
|
func (ps *peerScore) DeliverMessage(msg *Message) {
|
||||||
ps.Lock()
|
ps.Lock()
|
||||||
defer ps.Unlock()
|
defer ps.Unlock()
|
||||||
@ -382,15 +391,6 @@ func (ps *peerScore) DeliverMessage(msg *Message) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ps *peerScore) ValidateMessage(msg *Message) {
|
|
||||||
ps.Lock()
|
|
||||||
defer ps.Unlock()
|
|
||||||
|
|
||||||
// the pubsub subsystem is beginning validation; create a record to track time in
|
|
||||||
// the validation pipeline with an accurate firstSeen time.
|
|
||||||
_ = ps.deliveries.getRecord(ps.msgID(msg.Message))
|
|
||||||
}
|
|
||||||
|
|
||||||
func (ps *peerScore) RejectMessage(msg *Message, reason string) {
|
func (ps *peerScore) RejectMessage(msg *Message, reason string) {
|
||||||
ps.Lock()
|
ps.Lock()
|
||||||
defer ps.Unlock()
|
defer ps.Unlock()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user