Skip to content

Commit

Permalink
mq: remove pid
Browse files Browse the repository at this point in the history
  • Loading branch information
loongy committed Jul 1, 2020
1 parent 623f2eb commit 33d3a45
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions mq/mq.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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{}),
}
}

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 33d3a45

Please sign in to comment.