Skip to content

Commit f2cfca9

Browse files
committed
Some fixes
1 parent 2b01a81 commit f2cfca9

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

service/lib/ethplorer.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ class Ethplorer {
136136

137137
protected $useOperations2 = FALSE;
138138

139+
protected $getTokensCacheCreation = FALSE;
140+
139141
/**
140142
* Constructor.
141143
*
@@ -977,7 +979,10 @@ public function getTokens($updateCache = false){
977979
return $this->aTokens;
978980
}
979981
$aResult = $this->oCache->get('tokens', false, true);
980-
if($updateCache || (false === $aResult)){
982+
if(!$this->getTokensCacheCreation && ($updateCache || (false === $aResult))){
983+
// Recursion protection
984+
$this->getTokensCacheCreation = true;
985+
981986
evxProfiler::checkpoint('getTokens', 'START');
982987
$aPrevTokens = array();
983988
if($updateCache){
@@ -2081,7 +2086,7 @@ protected function _sortByTxCount($a, $b){
20812086
public function getTokenHistoryGrouped($period = 30, $address = FALSE, $type = 'daily', $cacheLifetime = 1800, $showEth = FALSE, $updateCache = FALSE){
20822087
$cache = 'token_history_grouped-' . ($address ? ($address . '-') : '') . $period . (($type == 'hourly') ? '-hourly' : '') . ($showEth ? '-eth' : '');
20832088
$result = $address ? $this->oCache->get($cache, false, true, $cacheLifetime) : $this->oCache->get($cache, false, true);
2084-
if(FALSE === $result || $updateCache){
2089+
if(($address && FALSE === $result) || $updateCache){
20852090
// Chainy
20862091
if($address && ($address == self::ADDRESS_CHAINY)){
20872092
return $this->getChainyTokenHistoryGrouped($period);
@@ -2805,7 +2810,7 @@ public function getAddressPriceHistoryGrouped($address, $updateCache = FALSE, $w
28052810
return FALSE;
28062811
}
28072812

2808-
$aSearch = array('from', 'to', 'address');
2813+
$aSearch = array('from', 'to', 'address'); // @todo: research "addresses"
28092814
$aTypes = array('transfer', 'issuance', 'burn', 'mint');
28102815
$aResult = array();
28112816
$aContracts = array();

0 commit comments

Comments
 (0)