Skip to content

Commit

Permalink
bugfix/separate-observer-parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita Neznaemov committed Oct 11, 2023
1 parent bf7b36d commit 21104b3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions observer/block_peer_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ func (bp *BlockPeer) initChannels(ctx context.Context) {
func (bp *BlockPeer) peerChannel(ctx context.Context, channel string) *blockPeerChannel {
seekFrom := bp.seekFrom[channel]
if seekFrom > 0 {
// it must be -1, because start position here is excluded from array
// https://github.com/s7techlab/hlf-sdk-go/blob/master/proto/seek.go#L15
seekFrom--
}

Expand Down
2 changes: 2 additions & 0 deletions observer/block_peer_common_concurrently.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ func (bp *BlockPeer) initChannelsConcurrently(ctx context.Context, blocksByChann
func (bp *BlockPeer) peerChannelConcurrently(ctx context.Context, channel string, blocksByChannels *BlocksByChannels) *blockPeerChannel {
seekFrom := bp.seekFrom[channel]
if seekFrom > 0 {
// it must be -1, because start position here is excluded from array
// https://github.com/s7techlab/hlf-sdk-go/blob/master/proto/seek.go#L15
seekFrom--
}

Expand Down
2 changes: 2 additions & 0 deletions observer/block_peer_parsed.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ func (pbp *ParsedBlockPeer) initParsedChannels(ctx context.Context) {
func (pbp *ParsedBlockPeer) peerParsedChannel(ctx context.Context, channel string) *parsedBlockPeerChannel {
seekFrom := pbp.blockPeer.seekFrom[channel]
if seekFrom > 0 {
// it must be -1, because start position here is excluded from array
// https://github.com/s7techlab/hlf-sdk-go/blob/master/proto/seek.go#L15
seekFrom--
}

Expand Down
2 changes: 2 additions & 0 deletions observer/block_peer_parsed_concurrently.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ func (pbp *ParsedBlockPeer) initParsedChannelsConcurrently(ctx context.Context,
func (pbp *ParsedBlockPeer) peerParsedChannelConcurrently(ctx context.Context, channel string, blocksByChannels *ParsedBlocksByChannels) *parsedBlockPeerChannel {
seekFrom := pbp.blockPeer.seekFrom[channel]
if seekFrom > 0 {
// it must be -1, because start position here is excluded from array
// https://github.com/s7techlab/hlf-sdk-go/blob/master/proto/seek.go#L15
seekFrom--
}

Expand Down

0 comments on commit 21104b3

Please sign in to comment.