From 5fa0f9ed6a2be05de0fc93d77aa66da3648bbdeb Mon Sep 17 00:00:00 2001 From: vyzo Date: Sun, 8 Mar 2020 22:11:26 +0200 Subject: [PATCH] more logical code ordering --- score.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/score.go b/score.go index 42dc439..7afb675 100644 --- a/score.go +++ b/score.go @@ -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()