Code Duplication    Length = 5-7 lines in 2 locations

include/classes/transaction.class.php 2 locations

@@ 402-406 (lines=5) @@
399
    $type == 'Debit_MP' ? $txfee = $this->config['txfee_manual'] : $txfee = $this->config['txfee_auto'];
400
    $amount = $amount - $txfee;
401
    // Add Debit record
402
    if (!$this->addTransaction($account_id, $amount, $type, NULL, $coin_address, NULL)) {
403
      $this->setErrorMessage('Failed to create ' . $type . ' transaction record in database');
404
      return false;
405
    }
406
    // Fetch the inserted record ID so we can return this at the end
407
    $transaction_id = $this->insert_id;
408
    // Add TXFee record
409
    if ($txfee > 0) {
@@ 409-415 (lines=7) @@
406
    // Fetch the inserted record ID so we can return this at the end
407
    $transaction_id = $this->insert_id;
408
    // Add TXFee record
409
    if ($txfee > 0) {
410
      if (!$this->addTransaction($account_id, $txfee, 'TXFee', NULL, $coin_address)) {
411
        $this->setErrorMessage('Failed to create TXFee transaction record in database: ' . $this->getError());
412
        return false;
413
      }
414
    }
415
    // Mark transactions archived
416
    if (!$this->setArchived($account_id, $this->insert_id)) {
417
      $this->setErrorMessage('Failed to mark transactions <= #' . $this->insert_id . ' as archived. ERROR: ' . $this->getError());
418
      return false;