server: harden lightning payment-attempt settlement against optimistic-lock races
Summary by CodeRabbit
- Bug Fixes
- Improved payment settlement reliability by preventing rare race conditions from leaving linked Lightning spend records in the wrong state.
- Linked payment-related outputs are now only marked as spent after the payment update is confirmed, reducing the chance of inconsistent status updates.
- Settled payments are now handled more consistently even when updates happen concurrently.
Edited by coderabbit