log
This commit is contained in:
@@ -290,7 +290,6 @@ class Block
|
|||||||
$db->commit();
|
$db->commit();
|
||||||
}
|
}
|
||||||
// relese the locking as everything is finished
|
// relese the locking as everything is finished
|
||||||
$db->exec("UNLOCK TABLES");
|
|
||||||
|
|
||||||
/***
|
/***
|
||||||
*
|
*
|
||||||
@@ -306,7 +305,7 @@ class Block
|
|||||||
if($res !== FALSE) {
|
if($res !== FALSE) {
|
||||||
|
|
||||||
$hostname = 'https://www.ariochain.info'; // hardcoded
|
$hostname = 'https://www.ariochain.info'; // hardcoded
|
||||||
_log("Supply",3);
|
_log("Calculate supply",3);
|
||||||
|
|
||||||
$apiUrl = $hostname.'/api.php?q=node-info';
|
$apiUrl = $hostname.'/api.php?q=node-info';
|
||||||
$aroUrl=file_get_contents($apiUrl);
|
$aroUrl=file_get_contents($apiUrl);
|
||||||
@@ -325,7 +324,8 @@ class Block
|
|||||||
|
|
||||||
if ($last>216000) {
|
if ($last>216000) {
|
||||||
$votes=[];
|
$votes=[];
|
||||||
$r=$this->db('SELECT id, val FROM votes');
|
$r=$db->run("SELECT id,val FROM votes");
|
||||||
|
|
||||||
foreach ($r as $vote) {
|
foreach ($r as $vote) {
|
||||||
$votes[$vote['id']]=$vote['val'];
|
$votes[$vote['id']]=$vote['val'];
|
||||||
}
|
}
|
||||||
@@ -380,6 +380,8 @@ class Block
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$db->exec("UNLOCK TABLES");
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
10
sanity.php
10
sanity.php
@@ -96,16 +96,11 @@ $current = $block->current();
|
|||||||
if ($current['height']==1) {
|
if ($current['height']==1) {
|
||||||
echo "Bootstrapping!\n";
|
echo "Bootstrapping!\n";
|
||||||
$db_name=substr($_config['db_connect'], strrpos($_config['db_connect'], "dbname=")+7);
|
$db_name=substr($_config['db_connect'], strrpos($_config['db_connect'], "dbname=")+7);
|
||||||
<<<<<<< HEAD
|
|
||||||
$db_host=substr($_config['db_connect'], strpos($_config['db_connect'], ":host=")+6);
|
$db_host=substr($_config['db_connect'], strpos($_config['db_connect'], ":host=")+6);
|
||||||
$db_host=substr($db_host, 0, strpos($db_host, ";"));
|
$db_host=substr($db_host, 0, strpos($db_host, ";"));
|
||||||
|
|
||||||
echo "DB name: $db_name\n";
|
echo "DB name: $db_name\n";
|
||||||
echo "DB host: $db_host\n";
|
echo "DB host: $db_host\n";
|
||||||
=======
|
|
||||||
$db_host=substr($_config['db_connect'], strrpos($_config['db_connect'], "host=")+5, strrpos($_config['db_connect'], ";") - strlen($_config['db_connect']));
|
|
||||||
echo "DB name: $db_name, DB host: $db_host\n";
|
|
||||||
>>>>>>> 8303376372d15ce8f69978d7e7ea495571c4affa
|
|
||||||
echo "Downloading the blockchain dump from arionum.info\n";
|
echo "Downloading the blockchain dump from arionum.info\n";
|
||||||
$arofile=__DIR__ . '/tmp/aro.sql';
|
$arofile=__DIR__ . '/tmp/aro.sql';
|
||||||
if (file_exists("/usr/bin/curl")) {
|
if (file_exists("/usr/bin/curl")) {
|
||||||
@@ -119,7 +114,6 @@ if ($current['height']==1) {
|
|||||||
|
|
||||||
echo "Importing the blockchain dump\n";
|
echo "Importing the blockchain dump\n";
|
||||||
system("mysql -h ".escapeshellarg($db_host)." -u ".escapeshellarg($_config['db_user'])." -p".escapeshellarg($_config['db_pass'])." ".escapeshellarg($db_name). " < ".$arofile);
|
system("mysql -h ".escapeshellarg($db_host)." -u ".escapeshellarg($_config['db_user'])." -p".escapeshellarg($_config['db_pass'])." ".escapeshellarg($db_name). " < ".$arofile);
|
||||||
<<<<<<< HEAD
|
|
||||||
echo "Bootstrapping completed. Waiting 2mins for the tables to be unlocked.\n";
|
echo "Bootstrapping completed. Waiting 2mins for the tables to be unlocked.\n";
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
@@ -134,10 +128,6 @@ if ($current['height']==1) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
=======
|
|
||||||
echo "Bootstrapping completed. Sleeping for 3 min. \n";
|
|
||||||
sleep(180);
|
|
||||||
>>>>>>> 8303376372d15ce8f69978d7e7ea495571c4affa
|
|
||||||
$current = $block->current();
|
$current = $block->current();
|
||||||
}
|
}
|
||||||
// the microsanity process is an anti-fork measure that will determine the best blockchain to choose for the last block
|
// the microsanity process is an anti-fork measure that will determine the best blockchain to choose for the last block
|
||||||
|
|||||||
Reference in New Issue
Block a user