Skip to content

Commit

Permalink
Create a DefaultMaxBlockSigopsCost to make it more clear when acting …
Browse files Browse the repository at this point in the history
…on that field
  • Loading branch information
dangershony committed Jun 2, 2020
1 parent fce1e98 commit 3d82f68
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/External/NBitcoin/ConsensusOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ namespace NBitcoin
/// </summary>
public class ConsensusOptions
{
private const int DefaultMaxBlockSigopsCost = 80000;

/// <summary>
/// Flag used to detect SegWit transactions.
/// </summary>
Expand Down Expand Up @@ -46,13 +48,13 @@ public class ConsensusOptions
public int MaxStandardTxWeight { get; set; } = 400000;

/// <summary>The maximum allowed number of signature check operations in a block (network rule).</summary>
public int MaxBlockSigopsCost { get; set; } = 80000;
public int MaxBlockSigopsCost { get; set; } = DefaultMaxBlockSigopsCost;

/// <summary>The maximum number of sigops we're willing to relay/mine in a single tx.</summary>
/// <remarks>
/// This value is calculated based on <see cref="MaxBlockSigopsCost"/> dived by 5.
/// </remarks>
public int MaxStandardTxSigopsCost { get; set; } = 80000 / 5; // MaxBlockSigopsCost / 5
public int MaxStandardTxSigopsCost { get; set; } = DefaultMaxBlockSigopsCost / 5;

/// <summary>Block Height at which the node should enforce the use of <see cref="EnforcedMinProtocolVersion"/>.
/// Can be set to zero to indicate that the minimum supported protocol version will not change depending on the block height.</summary>
Expand Down

0 comments on commit 3d82f68

Please sign in to comment.