Skip to content

Commit

Permalink
Fix list append bug
Browse files Browse the repository at this point in the history
  • Loading branch information
teddyding committed Sep 30, 2024
1 parent 1fb2b95 commit 804b7d2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions protocol/streaming/full_node_streaming_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ func getStreamUpdatesFromOffchainUpdates(
// Unmarshal each per-clob pair message to v1 updates.
streamUpdates = make([]clobtypes.StreamUpdate, len(clobPairIds))

for _, clobPairId := range clobPairIds {
for i, clobPairId := range clobPairIds {
v1updates, exists := clobPairIdToV1Updates[clobPairId]
if !exists {
panic(fmt.Sprintf(
Expand All @@ -525,7 +525,7 @@ func getStreamUpdatesFromOffchainUpdates(
clobPairIdToV1Updates,
))
}
streamUpdate := clobtypes.StreamUpdate{
streamUpdates[i] = clobtypes.StreamUpdate{
UpdateMessage: &clobtypes.StreamUpdate_OrderbookUpdate{
OrderbookUpdate: &clobtypes.StreamOrderbookUpdate{
Updates: v1updates,
Expand All @@ -535,7 +535,6 @@ func getStreamUpdatesFromOffchainUpdates(
BlockHeight: blockHeight,
ExecMode: uint32(execMode),
}
streamUpdates = append(streamUpdates, streamUpdate)
}

return streamUpdates, clobPairIds
Expand Down

0 comments on commit 804b7d2

Please sign in to comment.