Skip to content

Commit

Permalink
transaction: fix MaxConditionNesting
Browse files Browse the repository at this point in the history
Rework 75d1208 to follow neo-project/neo#3761,
let's have a real depth value in this constant.

Signed-off-by: Roman Khimov <[email protected]>
  • Loading branch information
roman-khimov committed Feb 17, 2025
1 parent d723235 commit d0e47c7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/core/transaction/witness_condition.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const (
WitnessCalledByGroup WitnessConditionType = 0x29 // CalledByGroup

// MaxConditionNesting limits the maximum allowed level of condition nesting.
MaxConditionNesting = 2
MaxConditionNesting = 3
)

// WitnessCondition is a condition of WitnessRule.
Expand Down Expand Up @@ -564,7 +564,7 @@ func DecodeBinaryCondition(r *io.BinReader) WitnessCondition {
}

func decodeBinaryCondition(r *io.BinReader, maxDepth int) WitnessCondition {
if maxDepth < 0 {
if maxDepth <= 0 {
r.Err = errors.New("too many nesting levels")
return nil
}
Expand Down Expand Up @@ -629,7 +629,7 @@ func UnmarshalConditionJSON(data []byte) (WitnessCondition, error) {
}

func unmarshalConditionJSON(data []byte, maxDepth int) (WitnessCondition, error) {
if maxDepth < 0 {
if maxDepth <= 0 {
return nil, errors.New("too many nesting levels")
}
aux := &conditionAux{}
Expand Down

0 comments on commit d0e47c7

Please sign in to comment.