fix lint errors.

This commit is contained in:
Raúl Kripalani 2020-09-04 10:54:56 +01:00
parent d46f684bb8
commit 905168e72e
3 changed files with 6 additions and 8 deletions

View File

@ -89,11 +89,11 @@ const (
// MessagePoolEvt is the journal entry for message pool events. // MessagePoolEvt is the journal entry for message pool events.
type MessagePoolEvt struct { type MessagePoolEvt struct {
Action string Action string
Messages []MessagePoolEvt_Message Messages []MessagePoolEvtMessage
Error error `json:",omitempty"` Error error `json:",omitempty"`
} }
type MessagePoolEvt_Message struct { type MessagePoolEvtMessage struct {
types.Message types.Message
CID cid.Cid CID cid.Cid
@ -145,7 +145,6 @@ type MessagePool struct {
sigValCache *lru.TwoQueueCache sigValCache *lru.TwoQueueCache
jrnl journal.Journal
evtTypes [3]journal.EventType evtTypes [3]journal.EventType
} }
@ -561,7 +560,7 @@ func (mp *MessagePool) addLocked(m *types.SignedMessage, limit bool) error {
journal.J.RecordEvent(mp.evtTypes[evtTypeMpoolAdd], func() interface{} { journal.J.RecordEvent(mp.evtTypes[evtTypeMpoolAdd], func() interface{} {
return MessagePoolEvt{ return MessagePoolEvt{
Action: "add", Action: "add",
Messages: []MessagePoolEvt_Message{{Message: m.Message, CID: m.Cid()}}, Messages: []MessagePoolEvtMessage{{Message: m.Message, CID: m.Cid()}},
} }
}) })
@ -725,7 +724,7 @@ func (mp *MessagePool) remove(from address.Address, nonce uint64) {
journal.J.RecordEvent(mp.evtTypes[evtTypeMpoolRemove], func() interface{} { journal.J.RecordEvent(mp.evtTypes[evtTypeMpoolRemove], func() interface{} {
return MessagePoolEvt{ return MessagePoolEvt{
Action: "remove", Action: "remove",
Messages: []MessagePoolEvt_Message{{Message: m.Message, CID: m.Cid()}}} Messages: []MessagePoolEvtMessage{{Message: m.Message, CID: m.Cid()}}}
}) })
mp.currentSize-- mp.currentSize--

View File

@ -136,9 +136,9 @@ func (mp *MessagePool) republishPendingMessages() error {
if len(msgs) > 0 { if len(msgs) > 0 {
journal.J.RecordEvent(mp.evtTypes[evtTypeMpoolRepub], func() interface{} { journal.J.RecordEvent(mp.evtTypes[evtTypeMpoolRepub], func() interface{} {
msgs := make([]MessagePoolEvt_Message, 0, len(msgs)) msgs := make([]MessagePoolEvtMessage, 0, len(msgs))
for _, m := range msgs { for _, m := range msgs {
msgs = append(msgs, MessagePoolEvt_Message{Message: m.Message, CID: m.Cid()}) msgs = append(msgs, MessagePoolEvtMessage{Message: m.Message, CID: m.Cid()})
} }
return MessagePoolEvt{ return MessagePoolEvt{
Action: "repub", Action: "repub",

View File

@ -22,7 +22,6 @@ type fsJournal struct {
dir string dir string
sizeLimit int64 sizeLimit int64
lk sync.Mutex
fi *os.File fi *os.File
fSize int64 fSize int64