Commit 50d23069 authored by shajiaiming's avatar shajiaiming

测试环境

parent 65b0e8a3
......@@ -92,20 +92,22 @@ class CrossChainController extends Controller
return 0;
}
//查询共识高度
// 正式环境查询共识高度
// $node_params = [
// 'scheme' => 'https',
// 'host' => 'jiedian1.bityuan.com',
// 'port' => 8801
// ];
$node_params = [
'scheme' => 'http',
'host' => '172.16.100.74',
'port' => 8801
];
$service = new Chain33Service($node_params);
$result = $service->getHeight();
$consensHeight = $result['result']['consensHeight'];
// 测试环境查询共识高度
// $node_params = [
// 'scheme' => 'http',
// 'host' => '172.16.100.77',
// 'port' => 8801
// ];
// $service = new Chain33Service($node_params);
// $result = $service->getHeight();
// $consensHeight = $result['result']['consensHeight'];
$current_time = time();
foreach ($model as $val) {
......@@ -120,6 +122,7 @@ class CrossChainController extends Controller
$send_result = $val['send_result'];
$result = $service->QueryTransaction($send_result);
$switch = true;
if (isset($result['result']['actionName']) && 'unknown' == $result['result']['actionName']) {
$redis->hdel(CoinCrossChain::CROSS_CHAIN_CACHE_FAIL, $val['address'] . ':' . $val['is_with_draw']);
$query_result = 'success';
......@@ -162,9 +165,9 @@ class CrossChainController extends Controller
doEnd :
if (CoinCrossChain::RECHARGE == $val['is_with_draw'] && $val['step'] == 1 && $switch && isset($height) && ($consensHeight < $height)) {
continue;
}
// if (CoinCrossChain::RECHARGE == $val['is_with_draw'] && $val['step'] == 1 && $switch && isset($height) && ($consensHeight < $height)) {
// continue;
// }
$currentModel = CoinCrossChain::findOne($val['id']);
$currentModel->query_result = $query_result;
......@@ -183,4 +186,14 @@ class CrossChainController extends Controller
echo date('Y-m-d H:i:s') . '查询完毕' . PHP_EOL;
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