diff --git a/Lib9c.Policy/Policy/BlockPolicySource.cs b/Lib9c.Policy/Policy/BlockPolicySource.cs index edd16ab940..5d31b60a2d 100644 --- a/Lib9c.Policy/Policy/BlockPolicySource.cs +++ b/Lib9c.Policy/Policy/BlockPolicySource.cs @@ -31,15 +31,22 @@ namespace Nekoyume.Blockchain.Policy { public partial class BlockPolicySource { - public const int MaxTransactionsPerBlock = 200; + public static int MaxTransactionsPerBlock; + + public const int DefaultMaxTransactionsPerBlock = 200; public static readonly TimeSpan BlockInterval = TimeSpan.FromSeconds(8); private readonly IActionLoader _actionLoader; - public BlockPolicySource(IActionLoader? actionLoader = null) + public BlockPolicySource( + IActionLoader? actionLoader = null, + int? maxTransactionPerBlock = null) { _actionLoader = actionLoader ?? new NCActionLoader(); + MaxTransactionsPerBlock = Math.Min( + maxTransactionPerBlock ?? DefaultMaxTransactionsPerBlock, + DefaultMaxTransactionsPerBlock); } ///