File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -258,10 +258,12 @@ public function getTransaction($tx){
258
258
$ cursor = $ this ->dbs ['transactions ' ]->find (array ("hash " => $ tx ));
259
259
$ result = $ cursor ->hasNext () ? $ cursor ->getNext () : false ;
260
260
if ($ result ){
261
+ $ receipt = isset ($ result ['receipt ' ]) ? $ result ['receipt ' ] : false ;
261
262
unset($ result ["_id " ]);
262
263
$ result ['gasLimit ' ] = $ result ['gas ' ];
263
264
unset($ result ["gas " ]);
264
- $ result ['gasUsed ' ] = isset ($ result ['receipt ' ]) ? $ result ['receipt ' ]['gasUsed ' ] : 0 ;
265
+ $ result ['gasUsed ' ] = $ receipt ? $ receipt ['gasUsed ' ] : 0 ;
266
+ $ success = (($ result ['gasUsed ' ] < $ result ['gasLimit ' ]) || ($ receipt && !empty ($ receipt ['logs ' ])));
265
267
$ result ['success ' ] = isset ($ result ['receipt ' ]) ? ($ result ['gasUsed ' ] < $ result ['gasLimit ' ]) : true ;
266
268
}
267
269
// evxProfiler::checkpoint('getTransaction FINISH [hash=' . $tx . ']');
You can’t perform that action at this time.
0 commit comments