Merge pull request #2641 from filecoin-project/feat/repub-less

only republish the next few messages from your mempool
This commit is contained in:
Whyrusleeping 2020-07-28 16:53:29 -07:00 committed by GitHub
commit b60f2deedb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -40,6 +40,8 @@ const futureDebug = false
const ReplaceByFeeRatio = 1.25
const repubMsgLimit = 5
var (
rbfNum = types.NewInt(uint64((ReplaceByFeeRatio - 1) * 256))
rbfDenom = types.NewInt(256)
@ -269,6 +271,10 @@ func (mp *MessagePool) repubLocal() {
log.Infow("republishing local messages", "n", len(outputMsgs))
}
if len(outputMsgs) > repubMsgLimit {
outputMsgs = outputMsgs[:repubMsgLimit]
}
for _, msg := range outputMsgs {
msgb, err := msg.Serialize()
if err != nil {