mirror of
https://github.com/fluencelabs/tendermint
synced 2025-04-25 23:02:16 +00:00
fixes from review
This commit is contained in:
parent
043c6018b4
commit
fb47ca6d35
@ -24,6 +24,10 @@ import (
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Config
|
// Config
|
||||||
|
|
||||||
|
const (
|
||||||
|
proposalHeartbeatIntervalSeconds = 2
|
||||||
|
)
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Errors
|
// Errors
|
||||||
|
|
||||||
@ -833,7 +837,7 @@ func (cs *ConsensusState) proposalHeartbeat(height, round int) {
|
|||||||
heartbeatEvent := types.EventDataProposalHeartbeat{heartbeat}
|
heartbeatEvent := types.EventDataProposalHeartbeat{heartbeat}
|
||||||
types.FireEventProposalHeartbeat(cs.evsw, heartbeatEvent)
|
types.FireEventProposalHeartbeat(cs.evsw, heartbeatEvent)
|
||||||
counter += 1
|
counter += 1
|
||||||
time.Sleep(time.Second)
|
time.Sleep(proposalHeartbeatIntervalSeconds * time.Second)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -224,7 +224,7 @@ func (mem *Mempool) resCbNormal(req *abci.Request, res *abci.Response) {
|
|||||||
tx: req.GetCheckTx().Tx,
|
tx: req.GetCheckTx().Tx,
|
||||||
}
|
}
|
||||||
mem.txs.PushBack(memTx)
|
mem.txs.PushBack(memTx)
|
||||||
mem.notifyIfTxsAvailable()
|
mem.notifyTxsAvailable()
|
||||||
} else {
|
} else {
|
||||||
// ignore bad transaction
|
// ignore bad transaction
|
||||||
mem.logger.Info("Bad Transaction", "res", r)
|
mem.logger.Info("Bad Transaction", "res", r)
|
||||||
@ -267,7 +267,7 @@ func (mem *Mempool) resCbRecheck(req *abci.Request, res *abci.Response) {
|
|||||||
atomic.StoreInt32(&mem.rechecking, 0)
|
atomic.StoreInt32(&mem.rechecking, 0)
|
||||||
mem.logger.Info("Done rechecking txs")
|
mem.logger.Info("Done rechecking txs")
|
||||||
|
|
||||||
mem.notifyIfTxsAvailable()
|
mem.notifyTxsAvailable()
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
// ignore other messages
|
// ignore other messages
|
||||||
@ -281,7 +281,7 @@ func (mem *Mempool) TxsAvailable() chan int {
|
|||||||
return mem.txsAvailable
|
return mem.txsAvailable
|
||||||
}
|
}
|
||||||
|
|
||||||
func (mem *Mempool) notifyIfTxsAvailable() {
|
func (mem *Mempool) notifyTxsAvailable() {
|
||||||
if mem.Size() == 0 {
|
if mem.Size() == 0 {
|
||||||
panic("notified txs available but mempool is empty!")
|
panic("notified txs available but mempool is empty!")
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user