Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
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
link33
plugin
Commits
9162df5c
Commit
9162df5c
authored
Mar 24, 2021
by
madengji
Committed by
vipwzw
Mar 25, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ticket close
parent
f18b8d76
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
+11
-5
ticket.go
plugin/dapp/ticket/commands/ticket.go
+1
-1
ticket.go
plugin/dapp/ticket/wallet/ticket.go
+10
-4
No files found.
plugin/dapp/ticket/commands/ticket.go
View file @
9162df5c
...
...
@@ -216,7 +216,7 @@ func closeTicket(cmd *cobra.Command, args []string) {
return
}
if
len
(
res
.
Hashes
)
==
0
{
fmt
.
Println
(
"no ticket to be close"
)
fmt
.
Println
(
"no ticket to be close
or close fail,to check log
"
)
return
}
...
...
plugin/dapp/ticket/wallet/ticket.go
View file @
9162df5c
...
...
@@ -12,6 +12,8 @@ import (
"sync/atomic"
"time"
"github.com/pkg/errors"
"github.com/33cn/chain33/client"
"github.com/33cn/chain33/common"
"github.com/33cn/chain33/common/address"
...
...
@@ -325,7 +327,7 @@ func (policy *ticketPolicy) forceCloseTicketByReturnAddr(height int64, minerAddr
keys
,
err
:=
policy
.
getWalletOperate
()
.
GetAllPrivKeys
()
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
ors
.
Wrap
(
err
,
"GetAllPrivKeys"
)
}
var
hashes
types
.
ReplyHashes
...
...
@@ -390,15 +392,19 @@ func (policy *ticketPolicy) getTickets(addr string, status int32) ([]*ty.Ticket,
func
(
policy
*
ticketPolicy
)
getForceCloseTickets
(
addr
string
)
([]
*
ty
.
Ticket
,
error
)
{
if
addr
==
""
{
return
nil
,
nil
return
nil
,
errors
.
Wrapf
(
types
.
ErrNotFound
,
"addr is nil"
)
}
tlist1
,
err1
:=
policy
.
getTickets
(
addr
,
1
)
if
err1
!=
nil
&&
err1
!=
types
.
ErrNotFound
{
return
nil
,
err
1
return
nil
,
err
ors
.
Wrap
(
err1
,
"status=1"
)
}
tlist2
,
err2
:=
policy
.
getTickets
(
addr
,
2
)
if
err2
!=
nil
&&
err2
!=
types
.
ErrNotFound
{
return
nil
,
err1
return
nil
,
errors
.
Wrap
(
err2
,
"status=2"
)
}
if
len
(
tlist1
)
+
len
(
tlist2
)
<=
0
{
return
nil
,
errors
.
Wrapf
(
types
.
ErrNotFound
,
"addr=%s no tickets in status=1&2"
,
addr
)
}
return
append
(
tlist1
,
tlist2
...
),
nil
...
...
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