Skip to content

Commit

Permalink
Merge pull request #2475 from planetarium/customize-max-transaction-p…
Browse files Browse the repository at this point in the history
…er-block

customize maxtransactionperblock
  • Loading branch information
area363 authored Mar 21, 2024
2 parents 0c8ec46 + 20d05c7 commit 0a369cb
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Lib9c.Policy/Policy/BlockPolicySource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/// <summary>
Expand Down

0 comments on commit 0a369cb

Please sign in to comment.