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
bfe51cf4
Commit
bfe51cf4
authored
Nov 05, 2019
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
生成撤销创建token 的交易
parent
1d33f3e2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
9 deletions
+26
-9
IssueChainTransferController.php
console/controllers/IssueChainTransferController.php
+26
-9
No files found.
console/controllers/IssueChainTransferController.php
View file @
bfe51cf4
...
...
@@ -226,15 +226,34 @@ class IssueChainTransferController extends Controller
$chain_service
=
new
Chain33Service
(
$node
);
foreach
(
$issue_coin_model
as
$val
)
{
$data
=
[];
$result
=
$chain_service
->
createRawTokenRevokeTx
(
$val
->
symbol
,
$val
->
owner
);
if
(
null
==
$val
->
transfer
)
{
//执行1.3构造
$result
=
$chain_service
->
CreateRawTokenRevokeTx
(
$val
->
symbol
,
$val
->
owner
);
if
(
null
!=
$result
[
'error'
])
{
$status
=
CoinIssueCoin
::
CANCEL_FAIL
;
$data
=
[
'pre_query_transaction'
=>
'fail'
];
goto
doEnd
;
}
if
(
null
!=
$result
[
'error'
])
{
$txHex
=
$result
[
'result'
];
$privkey
=
'8ac19c0b8858ccd6ed34e2bce0f11be2fc696e658d0b98fb1d3ef85ec5a3992c'
;
$expire
=
'1m'
;
//执行1.3签名
$signRawTx
=
$chain_service
->
signRawTx
(
$privkey
,
$txHex
,
$expire
);
if
(
0
!=
$signRawTx
[
'code'
])
{
$status
=
CoinIssueCoin
::
CANCEL_FAIL
;
$data
=
[
'pre_query_transaction'
=>
$result
[
'error'
]
'pre_query_transaction'
=>
'fail'
];
goto
doEnd
;
}
//执行1.3交易
$result
=
$chain_service
->
sendTransaction
(
$signRawTx
[
'result'
]);
if
(
0
!=
$result
[
'code'
])
{
$status
=
CoinIssueCoin
::
CANCEL_FAIL
;
$data
=
[
'pre_query_transaction'
=>
'fail'
];
goto
doEnd
;
}
...
...
@@ -246,11 +265,9 @@ class IssueChainTransferController extends Controller
CoinIssueCoin
::
updateAll
([
'status'
=>
$status
],
[
'id'
=>
$val
->
id
,
]);
if
(
false
!=
$data
)
{
CoinIssueChainRecord
::
updateAll
(
$data
,
[
'issue_coin_id'
=>
$val
->
id
,
]);
}
CoinIssueChainRecord
::
updateAll
(
$data
,
[
'issue_coin_id'
=>
$val
->
id
,
]);
}
echo
date
(
'Y-m-d H:i:s'
)
.
'已撤消'
.
PHP_EOL
;
return
0
;
...
...
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