Merge pull request #729 from filecoin-project/feat/limit-miner-block-messages

dont add too many messages to a block
This commit is contained in:
Łukasz Magiera 2019-12-04 13:02:08 +01:00 committed by GitHub
commit 35cad49115
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,6 +17,8 @@ import (
"golang.org/x/xerrors"
)
const MaxMessagesPerBlock = 4000
var log = logging.Logger("miner")
type waitFunc func(ctx context.Context, baseTime uint64) error
@ -424,6 +426,9 @@ func selectMessages(ctx context.Context, al actorLookup, base *MiningBase, msgs
inclCount[from]++
out = append(out, msg)
if len(out) >= MaxMessagesPerBlock {
break
}
}
return out, nil
}