Beispiel #1
0
 /**
  * @return array|\Bml\CoinBundle\Entity\TransactionListResult[]
  */
 public function getNewIncomingTransactions()
 {
     $round = $this->round;
     $newTransactions = [];
     /* @var $newTransactions \Bml\CoinBundle\Entity\TransactionListResult[] */
     $from = 0;
     $step = 10;
     do {
         $transactions = $this->manager->listTransactions($round->getWalletAccount(), $step, $from);
         $transactions = array_reverse($transactions);
         /* @var $transactions TransactionListResult[] */
         foreach ($transactions as $transaction) {
             if ($transaction->getCategory() != TransactionListResult::CATEGORY_RECEIVE) {
                 continue;
             }
             if ($transaction->getTxId() == $round->getStats()->getLastCheckedTx() || !$transactions) {
                 break 2;
             }
             if (!$this->depositRepo->findOneBy(['txIn' => $transaction->getTxId(), 'round' => $this->round])) {
                 $newTransactions[] = $transaction;
             }
         }
         $from += $step;
     } while (count($transactions));
     $newTransactions = array_reverse($newTransactions);
     return !empty($newTransactions) ? $newTransactions : null;
 }