Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
token
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wallet
token
Commits
50d23069
Commit
50d23069
authored
Sep 24, 2019
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
测试环境
parent
65b0e8a3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
12 deletions
+26
-12
CrossChainController.php
console/controllers/CrossChainController.php
+26
-12
No files found.
console/controllers/CrossChainController.php
View file @
50d23069
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment