Skip to content

Conversation

@xiuqiang1995
Copy link

Summary

Hardens the signed transfer endpoint against malformed requests and ambiguous validation failures.

Changes

  • Handle invalid/non-JSON request bodies safely (request.get_json(silent=True) + explicit 400)
  • Validate amount_rtc parsing errors with clear response
  • Reject non-finite numeric values (NaN/Infinity) before processing
  • Enforce RTC address shape (RTC prefix + expected length) for sender/recipient
  • Reject self-transfer (from_address == to_address)
  • Validate nonce as positive integer-like value before signature reconstruction

Why

Issue report flagged weak transfer validation behavior with unclear signature failures. This patch moves malformed input rejection earlier and returns deterministic validation errors before signature checking.

Related bounty issue: Scottcjn/rustchain-bounties#93

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant