Skip to content

Commit

Permalink
Merge pull request #129 from s7techlab/separate-observer-parsing-v2
Browse files Browse the repository at this point in the history
separate-observer-parsing-v2
  • Loading branch information
vitiko authored Oct 3, 2023
2 parents bd5ca79 + 639f088 commit aa789df
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions observer/block_channel_parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ func (p *ParsedBlockChannel) Observe(ctx context.Context) (<-chan *ParsedBlock,
return nil, fmt.Errorf("observe common blocks: %w", err)
}

p.blocks = make(chan *ParsedBlock)

go func() {
p.isWork = true

Expand Down
5 changes: 4 additions & 1 deletion observer/block_peer_parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ func WithConfigBlocks(configBlocks map[string]*common.Block) ParsedBlockPeerOpt

func NewParsedBlockPeer(blocksPeer *BlockPeer, opts ...ParsedBlockPeerOpt) *ParsedBlockPeer {
parsedBlockPeer := &ParsedBlockPeer{
blockPeer: blocksPeer,
blockPeer: blocksPeer,
parsedChannelObservers: make(map[string]*parsedBlockPeerChannel),
blocks: make(chan *ParsedBlock),
blocksByChannels: make(map[string]chan *ParsedBlock),
}

for _, opt := range opts {
Expand Down

0 comments on commit aa789df

Please sign in to comment.