close
Skip to content

Reject payment started without seller account - #8061

Open
fenlark wants to merge 1 commit into
bisq-network:masterfrom
fenlark:guard-api-payment-started-without-account
Open

Reject payment started without seller account#8061
fenlark wants to merge 1 commit into
bisq-network:masterfrom
fenlark:guard-api-payment-started-without-account

Conversation

@fenlark

@fenlark fenlark commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

CoreTradesService.confirmPaymentStarted checks only that the trade has
not failed and that its deposit tx is confirmed. Neither says anything
about the seller's payment account payload, which reaches the buyer
with the DepositTxAndDelayedPayoutTxMessage and can be absent on a
trade whose deposit the buyer confirmed from the wallet alone.

None of the five tasks in BuyerProtocol.onPaymentStarted reads that
payload: ApplyFilter treats it as nullable, the fee verification tasks
are no-ops, and the payout tasks use the contract only for addresses
and multisig keys. So the call succeeds, the trade moves to FIAT_SENT
and the payment started message goes to the seller for a payment the
buyer had no details to make.

FIAT_SENT is also past every phase in which the buyer still accepts
the DepositTxAndDelayedPayoutTxMessage, so the confirm closes the last
window in which the missing payload could still arrive.

Reject the call while the contract carries no seller payment account
payload. The check sits before the counter currency tx proof is
stored, so a rejected confirmpaymentstartedxmr leaves no proof data on
the trade.

The desktop client refuses the same state since #7955, which disables
the confirm button on the same contract payload.

Both rejection tests fail on master: without the guard the call reaches
onPaymentStarted and stores the tx proof. The third test covers the
normal path, so the guard cannot be widened unnoticed.

A precondition in BuyerProtocol would not work for this: FluentProtocol
returns before the task runner is built, so the gRPC caller would still
get an OK. A first task in onPaymentStarted would cover both clients,
but it runs after the phase is set and its failure writes an error
message on the trade, so it is a protocol change rather than the guard
this follow-up was about.

No specification change: this is a client-side precondition, not a rule
of the trade protocol, and neither of the two merged PRs for this issue
carried one.

Part of #7945

Summary by CodeRabbit

  • Bug Fixes
    • Payment-start confirmation is now rejected when required trade or seller payment details are missing.
    • Prevents payment-start actions from occurring when confirmation data is incomplete.
    • Valid payment-start confirmations continue to be processed successfully.

CoreTradesService.confirmPaymentStarted checks only that the trade has
not failed and that its deposit tx is confirmed. Neither says anything
about the seller's payment account payload, which reaches the buyer
with the DepositTxAndDelayedPayoutTxMessage and can be absent on a
trade whose deposit the buyer confirmed from the wallet alone.

None of the five tasks in BuyerProtocol.onPaymentStarted reads that
payload: ApplyFilter treats it as nullable, the fee verification tasks
are no-ops, and the payout tasks use the contract only for addresses
and multisig keys. So the call succeeds, the trade moves to FIAT_SENT
and the payment started message goes to the seller for a payment the
buyer had no details to make.

FIAT_SENT is also past every phase in which the buyer still accepts
the DepositTxAndDelayedPayoutTxMessage, so the confirm closes the last
window in which the missing payload could still arrive.

Reject the call while the contract carries no seller payment account
payload. The check sits before the counter currency tx proof is
stored, so a rejected confirmpaymentstartedxmr leaves no proof data on
the trade.

The desktop client refuses the same state since bisq-network#7955, which disables
the confirm button on the same contract payload.

Part of bisq-network#7945
@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 5fe9f317-1bde-4367-9bb3-127cd8072c43

📥 Commits

Reviewing files that changed from the base of the PR and between 3875ed4 and d19bf16.

📒 Files selected for processing (2)
  • core/src/main/java/bisq/core/api/CoreTradesService.java
  • core/src/test/java/bisq/core/api/CoreTradesServiceConfirmPaymentStartedTest.java

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

confirmPaymentStarted now checks for seller payment-account details before it sends the buyer payment-start message. Unit tests cover missing contract data, suppressed side effects, and successful delegation.

Changes

Payment-start validation

Layer / File(s) Summary
Contract precondition and delegation tests
core/src/main/java/bisq/core/api/CoreTradesService.java, core/src/test/java/bisq/core/api/CoreTradesServiceConfirmPaymentStartedTest.java
The service throws FailedPreconditionException when seller payment-account details are missing. Tests verify that no side effects occur on rejection and that valid data triggers protocol delegation.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to d19bf

The change rejects payment confirmation when seller payment details are absent, before trade state or proof data is updated. No actionable merge-blocking risk remains after normal checks and review.

Poem

A rabbit reads each line,
The patch grows clear beneath the moon,
Small changes hop in place,
Tests guard the garden path,
Reviews bloom before the dawn.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: rejecting payment-start confirmation when the seller payment account is missing.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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