Skip to content

Commit 263e08b

Browse files
committed
misc improvements
1 parent 74db3a4 commit 263e08b

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

assets_js_bitrequest_polling.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ function route_transaction_monitor(tx_data, api_dat, retry) {
3333
if (request) {
3434
const tx_hash = tx_data.txhash;
3535
if (tx_hash) {
36-
if (!tx_data.setconfirmations) {
37-
validate_confirmations(tx_data, true);
36+
const zero_conf = (tx_data.setconfirmations) ? false : true,
37+
status = validate_confirmations(tx_data, zero_conf);
38+
if (status === "paid") {
3839
return
3940
}
4041
const is_layer2 = tx_data.eth_layer2;
@@ -330,8 +331,7 @@ function validate_confirmations(tx_data, direct, ln) {
330331
is_instant = required_confirms === false || tx_data.instant_lock; // Dashpay instant_lock
331332

332333
status_panel.find("span#confnumber").text(confirm_text);
333-
new_status = tx_confirms;
334-
if (tx_confirms > current_confirms || is_instant === true || direct === true) {
334+
if (tx_confirms >= current_confirms || is_instant === true || direct === true) {
335335
clear_recent_requests();
336336
br_remove_session("txstatus"); // remove cached historical exchange rates
337337
confirm_box.removeClass("blob");
@@ -376,7 +376,6 @@ function validate_confirmations(tx_data, direct, ln) {
376376

377377
const exact_match = helper.exact,
378378
is_valid = crypto_symbol === "xmr" ? (received_formatted > (crypto_amount * 0.97) && received_formatted < (crypto_amount * 1.03)) : true; // error margin for xmr integrated addresses
379-
380379
if (is_valid) {
381380
const amount_valid = exact_match ? received_formatted === crypto_amount : received_formatted >= (crypto_amount * 0.97);
382381
if (amount_valid) {

0 commit comments

Comments
 (0)