Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix error. we need seek from block and we haven't received any blocks… #253

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions pkg/fab/events/deliverclient/deliverclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ func New(context fabcontext.Client, chConfig fab.ChannelCfg, discoveryService fa

dispatcher := dispatcher.New(context, chConfig, discoveryWrapper, params.connProvider, opts...)

//default seek type is `Newest`
// default seek type is `Newest`
if params.seekType == "" {
params.seekType = seek.Newest
//discard (do not publish) next BlockEvent/FilteredBlockEvent in dispatcher, since default seek type 'newest' is
// discard (do not publish) next BlockEvent/FilteredBlockEvent in dispatcher, since default seek type 'newest' is
// only needed for block height calculations
dispatcher.UpdateLastBlockInfoOnly()
}
Expand Down Expand Up @@ -134,9 +134,8 @@ func (c *Client) setSeekFromLastBlockReceived() error {
c.fromBlock = c.Dispatcher().LastBlockNum() + 1
logger.Debugf("Setting seek info from last block received + 1: %d", c.fromBlock)
} else {
// We haven't received any blocks yet. Just ask for the newest
logger.Debugf("Setting seek info from newest")
c.seekType = seek.Newest
// We haven't received any blocks yet. We will leave the seek which was set by client
logger.Debugf("We will leave the seek which was set by client ")
}
return nil
}
Expand Down