@@ -136,6 +136,8 @@ class Ethplorer {
136
136
137
137
protected $ useOperations2 = FALSE ;
138
138
139
+ protected $ getTokensCacheCreation = FALSE ;
140
+
139
141
/**
140
142
* Constructor.
141
143
*
@@ -977,7 +979,10 @@ public function getTokens($updateCache = false){
977
979
return $ this ->aTokens ;
978
980
}
979
981
$ 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
+
981
986
evxProfiler::checkpoint ('getTokens ' , 'START ' );
982
987
$ aPrevTokens = array ();
983
988
if ($ updateCache ){
@@ -2081,7 +2086,7 @@ protected function _sortByTxCount($a, $b){
2081
2086
public function getTokenHistoryGrouped ($ period = 30 , $ address = FALSE , $ type = 'daily ' , $ cacheLifetime = 1800 , $ showEth = FALSE , $ updateCache = FALSE ){
2082
2087
$ cache = 'token_history_grouped- ' . ($ address ? ($ address . '- ' ) : '' ) . $ period . (($ type == 'hourly ' ) ? '-hourly ' : '' ) . ($ showEth ? '-eth ' : '' );
2083
2088
$ 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 ){
2085
2090
// Chainy
2086
2091
if ($ address && ($ address == self ::ADDRESS_CHAINY )){
2087
2092
return $ this ->getChainyTokenHistoryGrouped ($ period );
@@ -2805,7 +2810,7 @@ public function getAddressPriceHistoryGrouped($address, $updateCache = FALSE, $w
2805
2810
return FALSE ;
2806
2811
}
2807
2812
2808
- $ aSearch = array ('from ' , 'to ' , 'address ' );
2813
+ $ aSearch = array ('from ' , 'to ' , 'address ' ); // @todo: research "addresses"
2809
2814
$ aTypes = array ('transfer ' , 'issuance ' , 'burn ' , 'mint ' );
2810
2815
$ aResult = array ();
2811
2816
$ aContracts = array ();
0 commit comments