Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/app/admin_cancel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,14 @@ pub async fn admin_cancel_action(
.await
.map_err(|e| MostroInternalErr(ServiceError::NostrError(e.to_string())))?;

// Phase 1: admin cancellation always releases any taker bond. The
// dispute slash path lands in Phase 2.
bond::release_bonds_for_order_or_warn(pool, order.id, "admin_cancel").await;
// Phase 2: `admin_cancel` means the buyer won the dispute (seller
// refund is reverted, buyer is paid out). The taker's identity
// follows from order kind (Sell-order taker = buyer, Buy-order
// taker = seller); when the taker lost AND the operator enabled
// `slash_on_lost_dispute`, the active taker bond moves to
// `pending-payout` for the Phase 3 payout job. Otherwise the bond
// is released — the Phase 1 behaviour preserved by default.
bond::apply_taker_dispute_outcome_or_warn(pool, &order, false, "admin_cancel").await;

Ok(())
}
10 changes: 7 additions & 3 deletions src/app/admin_settle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,13 @@ pub async fn admin_settle_action(
)
.await;
}
// Phase 1: admin-settled disputes always release any taker bond.
// Slashing on lost dispute lands in Phase 2.
bond::release_bonds_for_order_or_warn(pool, order_updated.id, "admin_settle").await;
// Phase 2: `admin_settle` means the seller won the dispute. The
// taker's identity follows from order kind (Sell-order taker = buyer,
// Buy-order taker = seller); when the taker lost AND the operator
// enabled `slash_on_lost_dispute`, the active taker bond moves to
// `pending-payout` for the Phase 3 payout job. Otherwise the bond
// is released — the Phase 1 behaviour preserved by default.
bond::apply_taker_dispute_outcome_or_warn(pool, &order_updated, true, "admin_settle").await;

let _ = do_payment(ctx, order_updated, request_id).await;

Expand Down
Loading