Skip to content

Commit

Permalink
add it at load pending tx too
Browse files Browse the repository at this point in the history
  • Loading branch information
sh-cha committed Nov 5, 2024
1 parent 6a23951 commit 8db5cef
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions node/broadcaster/broadcaster.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,18 @@ func (b *Broadcaster) prepareBroadcaster(ctx context.Context, lastBlockTime time
}

if txInfo.Save {
b.pendingProcessedMsgs = append(b.pendingProcessedMsgs, btypes.ProcessedMsgs{
Msgs: msgs,
Timestamp: time.Now().UnixNano(),
Save: txInfo.Save,
})
for i := 0; i < len(msgs); i += 5 {
end := i + 5
if end > len(msgs) {
end = len(msgs)
}

b.pendingProcessedMsgs = append(b.pendingProcessedMsgs, btypes.ProcessedMsgs{
Msgs: msgs[i:end],
Timestamp: time.Now().UnixNano(),
Save: true,
})
}
}

b.logger.Debug("pending tx", zap.Int("index", i), zap.String("tx", txInfo.String()))
Expand Down

0 comments on commit 8db5cef

Please sign in to comment.