Skip to content

Commit 6de34a4

Browse files
committed
fast fix
1 parent 70c60fb commit 6de34a4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

service/lib/ethplorer.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,6 +1135,7 @@ public function getTokenHolders($address, $limit = FALSE, $offset = FALSE){
11351135
public function getToken($address, $fast = FALSE){
11361136
// evxProfiler::checkpoint('getToken', 'START', 'address=' . $address);
11371137
$cache = 'token-' . $address;
1138+
$GLOBALS['recursion'] = 'getTokens';
11381139
if($fast){
11391140
$aTokens = $this->getTokens();
11401141
$result = isset($aTokens[$address]) ? $aTokens[$address] : false;
@@ -2290,8 +2291,10 @@ protected function getContractOperationCount($type, $address, $useFilter = TRUE,
22902291
$result += (int)$this->oMongo->count('operations', array_merge($search, array($field => array('$regex' => $this->filter))));
22912292
}
22922293
}else{
2293-
$aToken = $this->getToken($address);
2294-
if(('transfer' === $type) && $aToken){
2294+
if (!isset($GLOBALS['recursion'])) {
2295+
$aToken = $this->getToken($address);
2296+
}
2297+
if(('transfer' === $type) && !empty($aToken)) {
22952298
if($countEth) $result = isset($aToken['ethTransfersCount']) ? $aToken['ethTransfersCount'] : 0;
22962299
else $result = isset($aToken['transfersCount']) ? $aToken['transfersCount'] : 0;
22972300
}else{

0 commit comments

Comments
 (0)