From e178ccaac4829a595c49c6725ec3201e1019f18a Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Sat, 10 Nov 2018 13:08:10 +0100 Subject: [PATCH] Preparation for DigiByte rpcencoding (#289) Since 6.16.3, listtransactions requires '*' in account field And soon, it may require different rules for mining (algo) --- web/yaamp/commands/PayoutCommand.php | 5 ++++- web/yaamp/modules/site/coin_results.php | 7 ++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/web/yaamp/commands/PayoutCommand.php b/web/yaamp/commands/PayoutCommand.php index 759b248ba..84fbad6a9 100644 --- a/web/yaamp/commands/PayoutCommand.php +++ b/web/yaamp/commands/PayoutCommand.php @@ -133,9 +133,12 @@ public function checkPayouts($symbol, $fixit) 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) diff --git a/web/yaamp/modules/site/coin_results.php b/web/yaamp/modules/site/coin_results.php index f1667a976..f25bb91a3 100644 --- a/web/yaamp/modules/site/coin_results.php +++ b/web/yaamp/modules/site/coin_results.php @@ -4,7 +4,8 @@ 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 @@ 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);