public function getBlockByHash() { $hash = $this->bootstrap->route['hash']; $paycoin = new PaycoinDb(); $block = $paycoin->getBlockByHash($hash); $block['transaction'] = $paycoin->getTransactionsInBlock($block['height']); $this->outputJsonResponse($block); }
public function block() { $this->addJs('/js/block.js'); $hash = $this->bootstrap->route['hash']; $paycoin = new PaycoinDb(); $block = $paycoin->getBlockByHash($hash); if ($block != null) { $transactions = $paycoin->getTransactionsInBlock($block['height']); foreach ($transactions as $k => $transaction) { $transactions[$k]['vout'] = $paycoin->getTransactionsOut($transaction['txid']); $transactions[$k]['vin'] = $paycoin->getTransactionsIn($transaction['txid']); } $this->setData('transactions', $transactions); } $this->setData('hash', $hash); $this->setData('block', $block); $this->setData('pageTitle', 'Paycoin Block - ' . (int) $block['height']); $this->setData('cacheTime', 60); $this->render('header'); $this->render('block'); $this->render('footer'); }