@@ -142,7 +142,7 @@ func (d *AntispamStorage) index(ctx context.Context, h []byte) (*uint64, error)
142
142
d .numHits .Add (1 )
143
143
144
144
return item .Value (func (v []byte ) error {
145
- i := binary .LittleEndian .Uint64 (v )
145
+ i := binary .BigEndian .Uint64 (v )
146
146
idx = & i
147
147
return nil
148
148
})
@@ -247,7 +247,7 @@ func (f *follower) Follow(ctx context.Context, lr tessera.LogReader) {
247
247
return fmt .Errorf ("failed to get nextIdx: %v" , err )
248
248
default :
249
249
if err := row .Value (func (val []byte ) error {
250
- followFrom = binary .LittleEndian .Uint64 (val )
250
+ followFrom = binary .BigEndian .Uint64 (val )
251
251
return nil
252
252
}); err != nil {
253
253
return fmt .Errorf ("failed to get nextIdx value: %v" , err )
@@ -308,7 +308,7 @@ func (f *follower) Follow(ctx context.Context, lr tessera.LogReader) {
308
308
for i , e := range curEntries {
309
309
if _ , err := txn .Get (e ); err == badger .ErrKeyNotFound {
310
310
b := make ([]byte , 8 )
311
- binary .LittleEndian .PutUint64 (b , curIndex + uint64 (i ))
311
+ binary .BigEndian .PutUint64 (b , curIndex + uint64 (i ))
312
312
if err := txn .Set (e , b ); err != nil {
313
313
return err
314
314
}
@@ -321,7 +321,7 @@ func (f *follower) Follow(ctx context.Context, lr tessera.LogReader) {
321
321
322
322
// and update the follower state
323
323
b := make ([]byte , 8 )
324
- binary .LittleEndian .PutUint64 (b , curIndex + numAdded )
324
+ binary .BigEndian .PutUint64 (b , curIndex + numAdded )
325
325
if err := txn .Set (nextKey , b ); err != nil {
326
326
return fmt .Errorf ("failed to update follower state: %v" , err )
327
327
}
@@ -353,7 +353,7 @@ func (f *follower) EntriesProcessed(ctx context.Context) (uint64, error) {
353
353
return fmt .Errorf ("failed to read nextKey: %v" , err )
354
354
default :
355
355
return item .Value (func (val []byte ) error {
356
- nextIdx = binary .LittleEndian .Uint64 (val )
356
+ nextIdx = binary .BigEndian .Uint64 (val )
357
357
return nil
358
358
})
359
359
}
0 commit comments