more logical code ordering

This commit is contained in:
vyzo 2020-03-08 22:11:26 +02:00
parent ca6778bc83
commit 5fa0f9ed6a
1 changed files with 9 additions and 9 deletions

View File

@ -367,6 +367,15 @@ func (ps *peerScore) Prune(p peer.ID, topic string) {
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) {
ps.Lock()
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) {
ps.Lock()
defer ps.Unlock()