Preparation for DigiByte rpcencoding (#289)

Since 6.16.3, listtransactions requires '*' in account field
And soon, it may require different rules for mining (algo)
This commit is contained in:
Tanguy Pruvot 2018-11-10 13:08:10 +01:00
parent 38a114b8dd
commit e178ccaac4
2 changed files with 8 additions and 4 deletions

View file

@ -133,9 +133,12 @@ class PayoutCommand extends CConsoleCommand
if (empty($payouts) || empty($ids))
return 0;
$DCR = ($coin->rpcencoding == 'DCR' || $coin->getOfficialSymbol() == 'DCR');
$DGB = ($coin->rpcencoding == 'DGB' || $coin->getOfficialSymbol() == 'DGB');
$remote = new WalletRPC($coin);
$account = '';
if ($coin->rpcencoding == 'DCR') $account = '*';
if ($DCR || $DGB) $account = '*';
$rawtxs = $remote->listtransactions($account, 25000);
foreach ($ids as $uid => $user_addr)

View file

@ -4,7 +4,8 @@ $coin = getdbo('db_coins', getiparam('id'));
if (!$coin) $this->goback();
$PoS = ($coin->algo == 'PoS'); // or if 'stake' key is present in 'getinfo' method
$DCR = ($coin->rpcencoding == 'DCR');
$DCR = ($coin->rpcencoding == 'DCR' || $coin->getOfficialSymbol() == 'DCR');
$DGB = ($coin->rpcencoding == 'DGB' || $coin->getOfficialSymbol() == 'DGB');
$ETH = ($coin->rpcencoding == 'GETH');
$remote = new WalletRPC($coin);
@ -296,8 +297,8 @@ echo <<<end
end;
$account = '';
if ($DCR) $account = '*';
if ($ETH) $account = $coin->master_wallet;
if ($DCR || $DGB) $account = '*';
else if ($ETH) $account = $coin->master_wallet;
$txs = $remote->listtransactions($account, $maxrows);