missed: list each tier's skips in walk order

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-09-19 13:16:03 -05:00
parent c00ec64cf8
commit 0d2621defd
+1 -1
View File
@@ -28,7 +28,7 @@ function composeMissed(txEvents, who, had, site) {
const lines = ['\u{1F62C} <b>Missed payouts</b> on ' + who(buy.buyerId) + "'s " + price + ' purchase:']; const lines = ['\u{1F62C} <b>Missed payouts</b> on ' + who(buy.buyerId) + "'s " + price + ' purchase:'];
const passed = new Set(); let walked = 0; const passed = new Set(); let walked = 0;
for (const tier of [2, 3]) { for (const tier of [2, 3]) {
const sk = skips.filter(s => Number(s.tier) === tier); const sk = skips.filter(s => Number(s.tier) === tier).sort((x, y) => Number(x.li || 0) - Number(y.li || 0)); // walk order: nearest first
if (!sk.length) continue; if (!sk.length) continue;
const paid = txEvents.find(e => e.type === 'TierPaid' && Number(e.tier) === tier); const paid = txEvents.find(e => e.type === 'TierPaid' && Number(e.tier) === tier);
const pol = paid ? Number(fmtPol(paid.amountWei)) : Number(fmtPol(BigInt(String(buy.paidWei || 0)) * BigInt(Math.round(SHARE[tier] * 100)) / 100n)); const pol = paid ? Number(fmtPol(paid.amountWei)) : Number(fmtPol(BigInt(String(buy.paidWei || 0)) * BigInt(Math.round(SHARE[tier] * 100)) / 100n));