From 25f91f26922c934da74c482755c455c509aa72a8 Mon Sep 17 00:00:00 2001 From: J-Dog Date: Wed, 22 May 2024 13:59:12 -0700 Subject: [PATCH] cleanup --- indexer/includes/actions/callback.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/indexer/includes/actions/callback.php b/indexer/includes/actions/callback.php index a9a19ad..dc60304 100644 --- a/indexer/includes/actions/callback.php +++ b/indexer/includes/actions/callback.php @@ -128,11 +128,13 @@ function btnsCallback($params=null, $data=null, $error=null){ $balances = debitBalances($balances, $btInfo->CALLBACK_TICK, $data->CALLBACK_TICK); // Calculate total number of database hits for this CALLBACK - $db_hits = count($holders) * 3; // 1 debits, 1 credits, 1 balances - $db_hits += 4; // 1 debits, 1 credits, 1 balances, 1 callback + if(!$error){ + $db_hits = count($holders) * 3; // 1 debits, 1 credits, 1 balances + $db_hits += 4; // 1 debits, 1 credits, 1 balances, 1 callback - // Determine total transaction FEE based on database hits - $fees->AMOUNT = getTransactionFee($db_hits, $fees->TICK); + // Determine total transaction FEE based on database hits + $fees->AMOUNT = getTransactionFee($db_hits, $fees->TICK); + } // Verify SOURCE has enough balances to cover FEE AMOUNT if(!$error && !hasBalance($balances, $fees->TICK, $fees->AMOUNT))