mirror of
https://github.com/LBRYFoundation/pool.git
synced 2025-09-30 15:20:36 +00:00
tickets: proper error and show current balance
This commit is contained in:
parent
63f1032fb3
commit
f0bf43b72e
2 changed files with 7 additions and 1 deletions
|
@ -157,7 +157,10 @@ class SiteController extends CommonController
|
||||||
if ($coin && $maxamount) {
|
if ($coin && $maxamount) {
|
||||||
$remote = new Bitcoin($coin->rpcuser, $coin->rpcpasswd, $coin->rpchost, $coin->rpcport);
|
$remote = new Bitcoin($coin->rpcuser, $coin->rpcpasswd, $coin->rpchost, $coin->rpcport);
|
||||||
$res = $remote->purchaseticket($coin->account, $maxamount);
|
$res = $remote->purchaseticket($coin->account, $maxamount);
|
||||||
user()->setFlash('message', is_string($res) ? "ticket txid: $res" : json_encode($res));
|
if ($res === false)
|
||||||
|
user()->setFlash('error', $remote->error);
|
||||||
|
else
|
||||||
|
user()->setFlash('message', is_string($res) ? "ticket txid: $res" : json_encode($res));
|
||||||
}
|
}
|
||||||
$this->goback();
|
$this->goback();
|
||||||
}
|
}
|
||||||
|
|
|
@ -206,6 +206,9 @@ foreach($txs_array as $tx)
|
||||||
|
|
||||||
echo '</tbody></table><br>';
|
echo '</tbody></table><br>';
|
||||||
|
|
||||||
|
echo '<b>Balance: </b>'.$remote->getbalance().' '.$coin->symbol.'<br/>';
|
||||||
|
echo '<br/>';
|
||||||
|
|
||||||
echo '<b>Ticket price: </b>'.$stakeinfo['difficulty'].' + '.$remote->getticketfee().' '.$coin->symbol.'/kB<br/>';
|
echo '<b>Ticket price: </b>'.$stakeinfo['difficulty'].' + '.$remote->getticketfee().' '.$coin->symbol.'/kB<br/>';
|
||||||
echo '<b>Tickets: </b>'.$stakeinfo['live'];
|
echo '<b>Tickets: </b>'.$stakeinfo['live'];
|
||||||
if ($stakeinfo['immature']) echo ' + '.$stakeinfo['immature'].' immature';
|
if ($stakeinfo['immature']) echo ' + '.$stakeinfo['immature'].' immature';
|
||||||
|
|
Loading…
Add table
Reference in a new issue