Commit 4df77f4
committed
Ignore late failures for successful payments
rust-lightning documents that PaymentFailed can arrive after PaymentSent in
rare cases. In that ordering, the failure must be ignored and the payment
must be treated as successful:
https://github.com/lightningdevkit/rust-lightning/blob/9174965af9437196c527a9aa0df36bbcf050c8bb/lightning/src/events/mod.rs#L1230-L1233
Keep succeeded outbound Lightning records monotonic and suppress the
contradictory user-facing PaymentFailed event. Cover both BOLT11 and BOLT12
on the persistence-backed store path.
Developed with assistance from OpenAI Codex.1 parent be1d4e6 commit 4df77f4
2 files changed
Lines changed: 80 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1457 | 1457 | | |
1458 | 1458 | | |
1459 | 1459 | | |
1460 | | - | |
1461 | | - | |
1462 | | - | |
1463 | | - | |
1464 | | - | |
1465 | | - | |
1466 | | - | |
1467 | 1460 | | |
1468 | 1461 | | |
1469 | 1462 | | |
| |||
1477 | 1470 | | |
1478 | 1471 | | |
1479 | 1472 | | |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
| 1485 | + | |
| 1486 | + | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
| 1491 | + | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
1480 | 1499 | | |
1481 | 1500 | | |
1482 | 1501 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
317 | 317 | | |
318 | 318 | | |
319 | 319 | | |
320 | | - | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
321 | 334 | | |
322 | 335 | | |
323 | 336 | | |
| |||
1589 | 1602 | | |
1590 | 1603 | | |
1591 | 1604 | | |
| 1605 | + | |
| 1606 | + | |
| 1607 | + | |
| 1608 | + | |
| 1609 | + | |
| 1610 | + | |
| 1611 | + | |
| 1612 | + | |
| 1613 | + | |
| 1614 | + | |
| 1615 | + | |
| 1616 | + | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
| 1620 | + | |
| 1621 | + | |
1592 | 1622 | | |
1593 | 1623 | | |
1594 | 1624 | | |
| |||
1614 | 1644 | | |
1615 | 1645 | | |
1616 | 1646 | | |
| 1647 | + | |
| 1648 | + | |
| 1649 | + | |
| 1650 | + | |
1617 | 1651 | | |
1618 | 1652 | | |
1619 | 1653 | | |
| |||
1631 | 1665 | | |
1632 | 1666 | | |
1633 | 1667 | | |
| 1668 | + | |
| 1669 | + | |
| 1670 | + | |
| 1671 | + | |
| 1672 | + | |
| 1673 | + | |
| 1674 | + | |
| 1675 | + | |
| 1676 | + | |
| 1677 | + | |
| 1678 | + | |
| 1679 | + | |
| 1680 | + | |
| 1681 | + | |
| 1682 | + | |
| 1683 | + | |
| 1684 | + | |
| 1685 | + | |
| 1686 | + | |
1634 | 1687 | | |
1635 | 1688 | | |
1636 | 1689 | | |
| |||
0 commit comments