Commit 6168bb0
f - Recreate a missing pending index while the payment is still Pending
Classification treated an absent pending entry as proof the payment had
graduated and only merged into existing entries. But a crash or failed
write between the payment-store and pending-store writes leaves a Pending
record with no index entry, and that state was never repaired: the payment
could no longer graduate (graduation iterates the pending store) and its
candidate txids could no longer be mapped back to the record, which for an
RBF splice invites a duplicate generic payment. Decide by the post-write
payment status instead: while the record is still Pending, insert the
missing entry (embedding the post-write record, so a confirmation wallet
sync already mirrored keeps driving graduation); once it advanced beyond
Pending, keep treating absence as graduated. A graduated payment is never
Pending, so the no-reindex rule is preserved by the status gate itself.
The repaired state is not constructible in a test: it requires a failure
injected between the two store writes, and no such seam exists. The store
primitives the decision rests on are unit-tested.
Generated with assistance from Claude Code.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent 435caa6 commit 6168bb0
1 file changed
Lines changed: 21 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
58 | 57 | | |
59 | 58 | | |
60 | 59 | | |
| |||
1419 | 1418 | | |
1420 | 1419 | | |
1421 | 1420 | | |
1422 | | - | |
1423 | | - | |
1424 | | - | |
1425 | | - | |
1426 | | - | |
1427 | | - | |
1428 | | - | |
1429 | | - | |
1430 | | - | |
1431 | | - | |
1432 | | - | |
1433 | | - | |
1434 | | - | |
1435 | | - | |
1436 | | - | |
1437 | | - | |
1438 | | - | |
1439 | | - | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
1440 | 1442 | | |
1441 | 1443 | | |
1442 | 1444 | | |
| |||
0 commit comments