Commit 50d23069 authored by shajiaiming's avatar shajiaiming

测试环境

parent 65b0e8a3
...@@ -92,20 +92,22 @@ class CrossChainController extends Controller ...@@ -92,20 +92,22 @@ class CrossChainController extends Controller
return 0; return 0;
} }
//查询共识高度 // 正式环境查询共识高度
// $node_params = [ // $node_params = [
// 'scheme' => 'https', // 'scheme' => 'https',
// 'host' => 'jiedian1.bityuan.com', // 'host' => 'jiedian1.bityuan.com',
// 'port' => 8801 // 'port' => 8801
// ]; // ];
$node_params = [
'scheme' => 'http', // 测试环境查询共识高度
'host' => '172.16.100.74', // $node_params = [
'port' => 8801 // 'scheme' => 'http',
]; // 'host' => '172.16.100.77',
$service = new Chain33Service($node_params); // 'port' => 8801
$result = $service->getHeight(); // ];
$consensHeight = $result['result']['consensHeight']; // $service = new Chain33Service($node_params);
// $result = $service->getHeight();
// $consensHeight = $result['result']['consensHeight'];
$current_time = time(); $current_time = time();
foreach ($model as $val) { foreach ($model as $val) {
...@@ -120,6 +122,7 @@ class CrossChainController extends Controller ...@@ -120,6 +122,7 @@ class CrossChainController extends Controller
$send_result = $val['send_result']; $send_result = $val['send_result'];
$result = $service->QueryTransaction($send_result); $result = $service->QueryTransaction($send_result);
$switch = true; $switch = true;
if (isset($result['result']['actionName']) && 'unknown' == $result['result']['actionName']) { if (isset($result['result']['actionName']) && 'unknown' == $result['result']['actionName']) {
$redis->hdel(CoinCrossChain::CROSS_CHAIN_CACHE_FAIL, $val['address'] . ':' . $val['is_with_draw']); $redis->hdel(CoinCrossChain::CROSS_CHAIN_CACHE_FAIL, $val['address'] . ':' . $val['is_with_draw']);
$query_result = 'success'; $query_result = 'success';
...@@ -162,9 +165,9 @@ class CrossChainController extends Controller ...@@ -162,9 +165,9 @@ class CrossChainController extends Controller
doEnd : doEnd :
if (CoinCrossChain::RECHARGE == $val['is_with_draw'] && $val['step'] == 1 && $switch && isset($height) && ($consensHeight < $height)) { // if (CoinCrossChain::RECHARGE == $val['is_with_draw'] && $val['step'] == 1 && $switch && isset($height) && ($consensHeight < $height)) {
continue; // continue;
} // }
$currentModel = CoinCrossChain::findOne($val['id']); $currentModel = CoinCrossChain::findOne($val['id']);
$currentModel->query_result = $query_result; $currentModel->query_result = $query_result;
...@@ -183,4 +186,14 @@ class CrossChainController extends Controller ...@@ -183,4 +186,14 @@ class CrossChainController extends Controller
echo date('Y-m-d H:i:s') . '查询完毕' . PHP_EOL; echo date('Y-m-d H:i:s') . '查询完毕' . PHP_EOL;
return 0; return 0;
} }
protected function queryTransaction($node_params, $result)
{
$service = new Chain33Service($node_params);
$result = $service->QueryTransaction($result);
if (!isset($result['result']['tx']['next'])) {
return $result;
}
$this->queryTransaction($node_params, $result['result']['tx']['next']);
}
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment