Mainnet indexer fix + retire testnet copy
- chain.js: derive the chain tip as the MAX height across the RPC pool and scan getLogs against that same synced node. Load-balanced public RPCs (publicnode) intermittently answer eth_blockNumber from a replica lagging thousands of blocks behind, which stalled the mainnet scan (latest < lastBlock, 0 events) and could skip freshly-mined events. This unblocks the live ledger + the purchase-confirmation email (both driven by the event scan). - disclaimer: replace the "rehearsal/testnet" section with a live-on-Polygon real-money notice (it's live now). - Point the dead Amoy fallbacks (purchase email tx link, contract-page source link) at Polygon mainnet / the verified mainnet contract. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -279,7 +279,7 @@ async function emailOnEvent(ev) {
|
||||
};
|
||||
if (ev.type === 'Purchase') {
|
||||
const cc = chain.getConfig();
|
||||
const txUrl = (cc.explorer ? cc.explorer.replace(/\/+$/, '') : 'https://amoy.polygonscan.com') + '/tx/' + ev.tx;
|
||||
const txUrl = (cc.explorer ? cc.explorer.replace(/\/+$/, '') : 'https://polygonscan.com') + '/tx/' + ev.tx;
|
||||
let bal = ev.creditAmount;
|
||||
try { bal = await chain.creditBalance(ev.buyerId, ev.creditType); } catch (e) {}
|
||||
await notify(ev.buyerId, 'Your InstantAdPay purchase is confirmed',
|
||||
|
||||
Reference in New Issue
Block a user