Skip to content

Commit

Permalink
handle unused addresses gracefully
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-da committed Feb 5, 2016
1 parent 2f0ad09 commit e52d432
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 1 addition & 2 deletions bitprices.php
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,7 @@ protected function gen_report_tx( $results, $format ) {
$lifo_lot_id = 0;

$col_totals = array();
$map = $this->all_columns();

$nr = [];
$metalist = [];
Expand Down Expand Up @@ -863,8 +864,6 @@ function( $data )
$meta['addr'] = $r['addr'];
$meta['tx'] = $r['txid'];

$map = $this->all_columns();

$methods = array('fifo', 'lifo');
if( !in_array( $params['cost-method'], $methods ) ) {
throw new Exception( "Invalid cost method: " . $params['cost-method'] );
Expand Down
7 changes: 5 additions & 2 deletions lib/blockchain_api.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,11 @@ private function get_address_transactions( $addr, $start_time, $end_time, $param
mylogger()->log( "Received transactions from btcd.", mylogger::info );
}
catch( Exception $e ) {
mylogger()->log_exception($e);
mylogger()->log( "Handled exception while calling btcd::searchrawtransactions. continuing", mylogger::warning );
// code -5 : No information available about transaction
if( $e->getCode() != -5 ) {
mylogger()->log_exception($e);
mylogger()->log( "Handled exception while calling btcd::searchrawtransactions. continuing", mylogger::warning );
}
$tx_list = [];
}

Expand Down

0 comments on commit e52d432

Please sign in to comment.