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

worker: fix a bug of the delay timer. #1185

Merged
merged 1 commit into from
Nov 17, 2022

Conversation

setunapo
Copy link
Contributor

Description

fillTransactions will call commitTransactions twice, if the delay timer is expired during the first call, it will make the delay timer never be triggered in the second commitTransactions call. Pseudo code:
x := time.NewTimer(time.Second)
<-x.C
fmt.Println("read delay 1")
<-x.C
fmt.Println("read delay 2") // will never hit

Rationale

NA

Example

NA

Changes

NA

`fillTransactions` will call `commitTransactions` twice, if the delay
timer is expired during the first call, it will make the delay timer
never be triggered in the second commitTransactions call.
Pseudo code:
    x := time.NewTimer(time.Second)
    <-x.C
    fmt.Println("read delay 1")
    <-x.C
    fmt.Println("read delay 2")  // will never hit
@brilliant-lx brilliant-lx merged commit 139eb3f into bnb-chain:develop Nov 17, 2022
@setunapo setunapo deleted the work_develop branch February 5, 2023 04:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants