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
593f79f4
Commit
593f79f4
authored
Oct 09, 2019
by
shajiaiming
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/cross_chain' into 'master'
Feature/cross chain See merge request
!138
parents
e5254edb
b7896582
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
6 deletions
+23
-6
CrossChainController.php
console/controllers/CrossChainController.php
+23
-6
No files found.
console/controllers/CrossChainController.php
View file @
593f79f4
...
...
@@ -66,15 +66,17 @@ class CrossChainController extends Controller
$redis
->
hdel
(
CoinCrossChain
::
CROSS_CHAIN_TRANSFERING
,
$val
[
'address'
]
.
':'
.
$val
[
'is_with_draw'
]
.
':'
.
$val
[
'id'
]);
}
if
(
0
!=
$result
[
'code'
]
&&
(
true
==
strstr
(
$result
[
'msg'
],
'Balance'
)))
{
if
(
0
==
$result
[
'code'
])
{
$send_result
=
$result
[
'result'
];
$currentModel
=
CoinCrossChain
::
findOne
(
$val
[
'id'
]);
$currentModel
->
msg
=
$result
[
'msg'
];
$currentModel
->
send_result
=
$send_result
;
$currentModel
->
msg
=
0
;
$currentModel
->
save
();
$redis
->
hdel
(
CoinCrossChain
::
CROSS_CHAIN_TRANSFERING
,
$val
[
'address'
]
.
':'
.
$val
[
'is_with_draw'
]
.
':'
.
$val
[
'id'
]);
}
else
if
(
0
!=
$result
[
'code'
]
&&
(
false
==
strstr
(
$result
[
'msg'
],
'ErrDupTx'
)))
{
$redis
->
hdel
(
CoinCrossChain
::
CROSS_CHAIN_TRANSFERING
,
$val
[
'address'
]
.
':'
.
$val
[
'is_with_draw'
]
.
':'
.
$val
[
'id'
]);
}
else
{
$currentModel
=
CoinCrossChain
::
findOne
(
$val
[
'id'
]);
$currentModel
->
msg
=
$result
[
'msg'
];
$currentModel
->
save
();
}
});
}
...
...
@@ -124,7 +126,6 @@ class CrossChainController extends Controller
#$result = $service->QueryTransaction($send_result);
$switch
=
true
;
$result
=
$this
->
queryTransaction
(
$node_params
,
$send_result
);
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'
;
...
...
@@ -206,6 +207,21 @@ class CrossChainController extends Controller
}
}
if
(
isset
(
$result
[
'result'
][
'receipt'
])
&&
is_array
(
$result
[
'result'
][
'receipt'
][
'logs'
])){
foreach
(
$result
[
'result'
][
'receipt'
][
'logs'
]
as
$log
)
{
if
(
isset
(
$log
[
'tyName'
])
&&
'logerr'
==
strtolower
(
$log
[
'tyName'
])){
return
$result
;
}
}
}
// static $result = [];
// $service = new Chain33Service($node_params);
// $result = $service->QueryTransaction($send_result);
// echo json_encode($result) . PHP_EOL;
// if (isset($result['result']['tx']['next'])) {
// $this->queryTransaction($node_params, $result['result']['tx']['next']);
// }
// return $result;
}
}
\ 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