Skip to content

Detect negative-weight edges in the payment graph checker #773

Description

@Kingsman-99

Description

PaymentGraphChecker validates the structure of payment graphs but does not detect edges with negative weights (amounts). A negative-weight edge can cause unbounded fund extraction when the graph is traversed greedily.

Acceptance Criteria

  • checkGraph(graph) returns a validation failure when any edge has weight < 0
  • The failure message names the offending edge (source to target)
  • Valid graphs with all non-negative weights continue to pass
  • Unit tests pass

Context

  • Target file: src/graph/PaymentGraphChecker.ts
  • Zero-weight edges are allowed (they represent pass-through hops)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions