From 33d3a4567691fee82ff4678098a00b052c3ec7b7 Mon Sep 17 00:00:00 2001 From: Loong Date: Wed, 1 Jul 2020 17:17:31 +1000 Subject: [PATCH] mq: remove pid --- mq/mq.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mq/mq.go b/mq/mq.go index 371549d5..173af29c 100644 --- a/mq/mq.go +++ b/mq/mq.go @@ -5,6 +5,7 @@ import ( "sort" "github.com/renproject/hyperdrive/process" + "github.com/renproject/id" ) // A MessageQueue is used to sort incoming messages by their height and round, @@ -17,13 +18,13 @@ import ( // do not handle de-duplication, and are not safe for concurrent use. type MessageQueue struct { opts Options - queuesByPid map[process.Pid][]interface{} + queuesByPid map[id.Signatory][]interface{} } // New returns an empty MessageQueue. func New(opts Options) MessageQueue { return MessageQueue{ - queuesByPid: make(map[process.Pid][]interface{}), + queuesByPid: make(map[id.Signatory][]interface{}), } } @@ -135,7 +136,7 @@ func round(msg interface{}) process.Round { } } -func from(msg interface{}) process.Pid { +func from(msg interface{}) id.Signatory { switch msg := msg.(type) { case process.Propose: return msg.From