mirror of
https://github.com/fluencelabs/tendermint
synced 2025-07-31 20:21:56 +00:00
fix race condition on proposal height for published txs (#2021)
* #1920 try to fix race condition on proposal height for published txs - related to create_empty_blocks=false - published height for accepted tx can be wrong (too low) - use the actual mempool height + 1 for the proposal - expose Height() on mempool * #1920 add initial test for mempool.Height() - not sure how to test the lock - can the mutex reference be of type Locker? -- this way, we can use a "mock" of the mutex to test triggering * #1920 use the ConsensusState height in favor of mempool - gets rid of indirections - doesn't need any "+1" magic * #1920 cosmetic - if we use cs.Height, it's enough to evaluate right before propose * #1920 cleanup TODO and non-needed code * #1920 add changelog entry
This commit is contained in:
@@ -38,7 +38,7 @@ func newMempoolWithApp(cc proxy.ClientCreator) *Mempool {
|
||||
return mempool
|
||||
}
|
||||
|
||||
func ensureNoFire(t *testing.T, ch <-chan int64, timeoutMS int) {
|
||||
func ensureNoFire(t *testing.T, ch <-chan bool, timeoutMS int) {
|
||||
timer := time.NewTimer(time.Duration(timeoutMS) * time.Millisecond)
|
||||
select {
|
||||
case <-ch:
|
||||
@@ -47,7 +47,7 @@ func ensureNoFire(t *testing.T, ch <-chan int64, timeoutMS int) {
|
||||
}
|
||||
}
|
||||
|
||||
func ensureFire(t *testing.T, ch <-chan int64, timeoutMS int) {
|
||||
func ensureFire(t *testing.T, ch <-chan bool, timeoutMS int) {
|
||||
timer := time.NewTimer(time.Duration(timeoutMS) * time.Millisecond)
|
||||
select {
|
||||
case <-ch:
|
||||
|
Reference in New Issue
Block a user