diff --git a/sql/2018-02-coins_getinfo.sql b/sql/2018-02-coins_getinfo.sql new file mode 100644 index 0000000..b3ea822 --- /dev/null +++ b/sql/2018-02-coins_getinfo.sql @@ -0,0 +1,13 @@ +-- Recent additions to add after db init (.gz) +-- mysql yaamp -p < file.sql + +-- filled by the stratum instance, to allow to handle/watch multiple instances + +ALTER TABLE `coins` ADD `hasgetinfo` tinyint(1) UNSIGNED NOT NULL DEFAULT '1' AFTER `account`; + +UPDATE coins SET hassubmitblock=0 WHERE hassubmitblock IS NULL; +UPDATE coins SET hassubmitblock=1 WHERE hassubmitblock > 0; +ALTER TABLE `coins` CHANGE `hassubmitblock` `hassubmitblock` tinyint(1) UNSIGNED NOT NULL DEFAULT '1'; + +ALTER TABLE `coins` ADD `no_explorer` tinyint(1) UNSIGNED NOT NULL DEFAULT '0' AFTER `visible`; + diff --git a/web/yaamp/models/db_coinsModel.php b/web/yaamp/models/db_coinsModel.php index 3446eb1..5ce150d 100644 --- a/web/yaamp/models/db_coinsModel.php +++ b/web/yaamp/models/db_coinsModel.php @@ -47,6 +47,7 @@ class db_coins extends CActiveRecord 'rpcssl' => 'RPC SSL', 'rpccert' => 'RPC Certificate', 'serveruser' => 'Server user', + 'hasgetinfo' => 'Has getinfo', 'hassubmitblock'=> 'Has submitblock', 'hasmasternodes'=> 'Masternodes', 'usesegwit' => 'Use segwit', diff --git a/web/yaamp/modules/explorer/ExplorerController.php b/web/yaamp/modules/explorer/ExplorerController.php index b122bf5..c165007 100644 --- a/web/yaamp/modules/explorer/ExplorerController.php +++ b/web/yaamp/modules/explorer/ExplorerController.php @@ -57,6 +57,14 @@ class ExplorerController extends CommonController $id = getiparam('id'); $coin = getdbo('db_coins', $id); + if($coin && $coin->no_explorer) { + $link = $coin->link_explorer; + //$txid = getparam('txid'); + //$hash = getparam('hash'); + //if (!empty($txid)) $link .= 'tx/'.$txid; + //elseif (!empty($hash)) $link .= 'block/'.$hash; + die("Block explorer disabled, please use $link"); + } $height = getiparam('height'); if($coin && intval($height)>0) { diff --git a/web/yaamp/modules/site/coin_form.php b/web/yaamp/modules/site/coin_form.php index af67481..3507ca4 100644 --- a/web/yaamp/modules/site/coin_form.php +++ b/web/yaamp/modules/site/coin_form.php @@ -147,6 +147,12 @@ echo CUFHtml::activeCheckBox($coin, 'installed'); echo '

Required to be visible in the Wallets board

'; echo CUFHtml::closeCtrlHolder(); +echo CUFHtml::openActiveCtrlHolder($coin, 'no_explorer'); +echo CUFHtml::activeLabelEx($coin, 'no_explorer'); +echo CUFHtml::activeCheckBox($coin, 'no_explorer'); +echo '

Disable block explorer for the public

'; +echo CUFHtml::closeCtrlHolder(); + echo CUFHtml::openActiveCtrlHolder($coin, 'watch'); echo CUFHtml::activeLabelEx($coin, 'watch'); echo CUFHtml::activeCheckBox($coin, 'watch'); @@ -201,6 +207,12 @@ echo CUFHtml::activeTextField($coin, 'charity_address', array('maxlength'=>200)) echo '

Foundation address if "dev fees" are required

'; echo CUFHtml::closeCtrlHolder(); +echo CUFHtml::openActiveCtrlHolder($coin, 'hasgetinfo'); +echo CUFHtml::activeLabelEx($coin, 'hasgetinfo'); +echo CUFHtml::activeCheckBox($coin, 'hasgetinfo'); +echo '

Enable if getinfo rpc method is present

'; +echo CUFHtml::closeCtrlHolder(); + echo CUFHtml::openActiveCtrlHolder($coin, 'hassubmitblock'); echo CUFHtml::activeLabelEx($coin, 'hassubmitblock'); echo CUFHtml::activeCheckBox($coin, 'hassubmitblock'); @@ -216,7 +228,7 @@ echo CUFHtml::closeCtrlHolder(); echo CUFHtml::openActiveCtrlHolder($coin, 'hasmasternodes'); echo CUFHtml::activeLabelEx($coin, 'hasmasternodes'); echo CUFHtml::activeCheckBox($coin, 'hasmasternodes'); -echo '

Require "payee" and "payee_amount" fields in getblocktemplate (DASH)

'; +echo '

Require "payee" and "payee_amount", or masternode object in getblocktemplate

'; echo CUFHtml::closeCtrlHolder(); echo CUFHtml::openActiveCtrlHolder($coin, 'usesegwit');