fix: a recipient warning on the confirmation screen is about the recipient on screen (closes #575)
checkRecipientHistory() showed the warning boxes whenever its lookups answered, so after Back and a review to another recipient, a late answer about the first recipient could show the never-sent-a-transaction, contract or Etherscan phishing box on the second recipient's screen. It now drops a result for a transaction no longer on screen, as estimateGas() and readBalances() already do. tests/confirmTxLateResult.test.js holds back the first screen's answer until the second screen is shown, for each of the three boxes, the balance read and the fee estimate. Model: opus-5-5
This commit was merged in pull request #605.
This commit is contained in:
@@ -609,6 +609,9 @@ async function checkRecipientHistory(txInfo) {
|
||||
fromAddress: txInfo.from,
|
||||
chainId: txInfo.chainId,
|
||||
});
|
||||
// The user may have left this transaction while the checks were in
|
||||
// flight; its warnings must not reach another recipient's screen.
|
||||
if (pendingTx !== txInfo) return;
|
||||
for (const w of asyncWarnings) {
|
||||
if (w.type === "contract") {
|
||||
$("confirm-contract-warning").style.visibility = "visible";
|
||||
|
||||
Reference in New Issue
Block a user