don't prune locally published messages

This commit is contained in:
vyzo 2020-09-11 20:32:52 +03:00
parent c017d0fbaf
commit cf9820137c

View File

@ -56,6 +56,13 @@ func (mp *MessagePool) pruneMessages(ctx context.Context, ts *types.TipSet) erro
priority[actor] = struct{}{} priority[actor] = struct{}{}
} }
// we also never prune locally published messages
mp.lk.Lock()
for actor := range mp.localAddrs {
priority[actor] = struct{}{}
}
mp.lk.Unlock()
// Collect all messages to track which ones to remove and create chains for block inclusion // Collect all messages to track which ones to remove and create chains for block inclusion
pruneMsgs := make(map[cid.Cid]*types.SignedMessage, mp.currentSize) pruneMsgs := make(map[cid.Cid]*types.SignedMessage, mp.currentSize)
keepCount := 0 keepCount := 0