Commit 9ae1ddb3 authored by heyubin's avatar heyubin Committed by vipwzw

add by hyb for issues109

parent 1bc1534a
......@@ -212,12 +212,12 @@ func (client *Client) setTicket(tlist *ty.ReplyTicketList, privmap map[string]cr
func (client *Client) flushTicket() error {
//list accounts
tickets, privs, err := client.getTickets()
if err == types.ErrMinerNotStared || err == types.ErrWalletIsLocked {
tlog.Error("flushTicket error", "err", "wallet miner not start or wallet is locked")
if err == types.ErrWalletIsLocked {
tlog.Error("flushTicket error", "err", "wallet is locked")
client.setTicket(nil, nil)
return nil
}
if err != nil && err != types.ErrMinerNotStared {
if err != nil {
tlog.Error("flushTicket error", "err", err)
return err
}
......
......@@ -393,14 +393,10 @@ func (policy *ticketPolicy) getTicketsByStatus(status int32) ([]*ty.Ticket, [][]
}
operater.GetMutex().Lock()
defer operater.GetMutex().Unlock()
ok, err := operater.CheckWalletStatus()
if !ok && err != types.ErrOnlyTicketUnLocked {
return nil, nil, err
}
if !policy.IsAutoMining() {
return nil, nil, types.ErrMinerNotStared
}
//循环遍历所有的账户-->保证钱包已经解锁
var tickets []*ty.Ticket
var privs [][]byte
......
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