From 7a7479588922641a090c75fe821da6d449d7a212 Mon Sep 17 00:00:00 2001 From: tripathyr Date: Wed, 3 Sep 2025 17:09:00 +0530 Subject: [PATCH] Update main_UI.js Added sender check .. it should be from cashier --- js/main_UI.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/js/main_UI.js b/js/main_UI.js index 59ef8f3..75fa02b 100644 --- a/js/main_UI.js +++ b/js/main_UI.js @@ -429,6 +429,21 @@ const oldInterns = { "FCqLr9nymnbh7ahta1gGC78z634y4GHJGQ": "Rakhijeet Singh", "FEHKFxQxycsxw2qQQSn2Y1BCT6Mfb8EMko": "Abhijeet Anand", } +function getInputAddresses(tx) { + const ins = tx?.vin || []; + const out = []; + for (const v of ins) { + // Blockbook puts addresses in vin[i].addresses + const addrs = v?.addresses || (v?.addr ? [v.addr] : []); + for (const a of addrs) if (a) out.push(a); + } + return out; +} +function isFromPayer(tx) { + const ins = getInputAddresses(tx); + // Must have at least one input AND all inputs must be the cashier + return ins.length > 0 && ins.every(a => a === floGlobals.payer); +} function getReceiverAddress(vout) { // return the first address in outputs that isn't the payer for (const output of vout) { @@ -453,6 +468,7 @@ function main() { ...oldInterns } txs.forEach((tx) => { + if (!isFromPayer(tx)) { return; } const floId = getReceiverAddress(tx.vout); if (!floGlobals.appObjects.RIBC.internList[floId]) return; // not an intern const { txid, floData, time } = tx