From 2e75d9c80ae5301745e59612f1d9a7bff9aa02cf Mon Sep 17 00:00:00 2001 From: vyzo Date: Sun, 6 Sep 2020 13:36:25 +0300 Subject: [PATCH] be explicit about republish interval, check against timecache duration --- chain/messagepool/messagepool.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/chain/messagepool/messagepool.go b/chain/messagepool/messagepool.go index 0d62e5423..72d0a01ab 100644 --- a/chain/messagepool/messagepool.go +++ b/chain/messagepool/messagepool.go @@ -45,7 +45,7 @@ var rbfDenomBig = types.NewInt(RbfDenom) const RbfDenom = 256 -var RepublishInterval = pubsub.TimeCacheDuration + time.Duration(5*build.BlockDelaySecs+build.PropagationDelaySecs)*time.Second +var RepublishInterval = time.Duration(10*build.BlockDelaySecs+build.PropagationDelaySecs) * time.Second var minimumBaseFee = types.NewInt(uint64(build.MinimumBaseFee)) var baseFeeLowerBoundFactor = types.NewInt(10) @@ -81,6 +81,14 @@ const ( localUpdates = "update" ) +func init() { + // if the republish interval is too short compared to the pubsub timecache, adjust it + minInterval := pubsub.TimeCacheDuration + time.Duration(build.PropagationDelaySecs) + if RepublishInterval < minInterval { + RepublishInterval = minInterval + } +} + type MessagePool struct { lk sync.Mutex