Commit 0e04a3e
committed
fix(payments): retest reuses live session instead of re-paying (double-pay #2)
With autoCancelAfterTest OFF (the default) main-pass sessions stay ACTIVE after
testing, so the in-runAudit retest blocks (internet-failure + Iron-Rule) that did
clearPaidNodes()+re-test created a SECOND paid session per node while the first
deposit was still locked — a real double-pay from the live wallet.
Fix (reviewed): remove clearPaidNodes() from those two retest blocks so nodes keep
their paid flag, and change node-test.js's retest branch to re-query
findExistingSession and REUSE the still-active session (no new payment); it clears
the paid flag and pays fresh only when no active session is found (autoCancel ON
cancelled it, or it expired). Mirrors the proven !retestMode recovery path.
Verified by adversarial review: findExistingSession returns ONLY active sessions
(status 1/'active'; cancelled inactive_pending filtered at session.js:133), so
reuse can never resurrect a dead session and autoCancel-ON correctly pays fresh.
Manual retest (clearPaidNodes at run start), TEST RUN, balance-pause, and orphan-
cancel paths unaffected. Test suite green (188/31/45/35).1 parent 0f5bed4 commit 0e04a3e
2 files changed
Lines changed: 32 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
294 | 294 | | |
295 | 295 | | |
296 | 296 | | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
301 | 322 | | |
302 | 323 | | |
303 | 324 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1081 | 1081 | | |
1082 | 1082 | | |
1083 | 1083 | | |
1084 | | - | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
1085 | 1088 | | |
1086 | 1089 | | |
1087 | 1090 | | |
| |||
1154 | 1157 | | |
1155 | 1158 | | |
1156 | 1159 | | |
1157 | | - | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
1158 | 1163 | | |
1159 | 1164 | | |
1160 | 1165 | | |
| |||
0 commit comments