From 9039eb29dc83f9e2bf15393717d8dbc16cac0755 Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Tue, 11 Feb 2014 16:35:01 +0100 Subject: [PATCH] [FIX] Do not add TXFee with txfee 0 --- public/include/classes/transaction.class.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/public/include/classes/transaction.class.php b/public/include/classes/transaction.class.php index c19f3947..3fe76a61 100644 --- a/public/include/classes/transaction.class.php +++ b/public/include/classes/transaction.class.php @@ -342,9 +342,11 @@ class Transaction extends Base { // Fetch the inserted record ID so we can return this at the end $transaction_id = $this->insert_id; // Add TXFee record - if (!$this->addTransaction($account_id, $txfee, 'TXFee', NULL, $coin_address)) { - $this->setErrorMessage('Failed to create TXFee transaction record in database: ' . $this->getError()); - return false; + if ($txfee > 0) { + if (!$this->addTransaction($account_id, $txfee, 'TXFee', NULL, $coin_address)) { + $this->setErrorMessage('Failed to create TXFee transaction record in database: ' . $this->getError()); + return false; + } } // Mark transactions archived if (!$this->setArchived($account_id, $this->insert_id)) {