Skip to content

Commit

Permalink
fix: 在没有新区块时, 完成历史数据的推送
Browse files Browse the repository at this point in the history
  • Loading branch information
linj-disanbo authored and 33cn committed Mar 24, 2021
1 parent 1581a58 commit cf8ba79
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions blockchain/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,16 @@ func (push *Push) runTask(input *pushNotify) {
}
continueFailCount = 0
lastProcessedseq = updateSeq
// 在联盟链情况下, 无新增交易的情况下, 不会完成从新开始同步
// 在公链情况下, 需要有新区块才能触发推送,
// 所以这里在未同步到最新区块, 需要主动触发同步
if lastProcessedseq < lastesBlockSeq {
push.mu.Lock()
if len(in.seqUpdateChan) == 0 {
in.seqUpdateChan <- lastesBlockSeq
}
push.mu.Unlock()
}
case <-in.closechan:
push.postwg.Done()
chainlog.Info("getPushData", "push task closed for subscribe", subscribe.Name)
Expand Down

0 comments on commit cf8ba79

Please sign in to comment.