Skip to content

Commit

Permalink
Increase delimiter to avoid deserialization error (#2370)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkrvivian authored Aug 4, 2022
1 parent c58fdaf commit e3bd029
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/core/snapshot/read.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func scanDelimiter(data []byte, atEOF bool) (advance int, token []byte, err erro
return 0, nil, nil
}
if i := bytes.Index(data, delimiter); i >= 0 {
return i + 2, data[0:i], nil
return i + len(delimiter), data[0:i], nil
}
// at EOF, return rest of data.
if atEOF {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/snapshot/write.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

const utxoStatesChunkSize = 100

var delimiter = []byte{';', ';'}
var delimiter = []byte{';', ';', ';'}

// streamSnapshotDataTo writes snapshot to a given writer.
func streamSnapshotDataTo(
Expand Down

0 comments on commit e3bd029

Please sign in to comment.