Commit 73a89db2 authored by madengji's avatar madengji Committed by vipwzw

fix issue

parent dea52cdf
...@@ -254,9 +254,10 @@ func (a *action) unbind2Node(node string) (*types.Receipt, error) { ...@@ -254,9 +254,10 @@ func (a *action) unbind2Node(node string) (*types.Receipt, error) {
old := proto.Clone(list).(*pt.ParaNodeBindList) old := proto.Clone(list).(*pt.ParaNodeBindList)
for _, m := range list.Miners { for _, m := range list.Miners {
if m.SuperNode != node && m.Miner != a.fromaddr { if m.SuperNode == node && m.Miner == a.fromaddr {
newList.Miners = append(newList.Miners, m) continue
} }
newList.Miners = append(newList.Miners, m)
} }
return makeNodeBindReceipt(old, newList), nil return makeNodeBindReceipt(old, newList), nil
...@@ -378,6 +379,10 @@ func (a *action) unBindOp(cmd *pt.ParaBindMinerCmd) (*types.Receipt, error) { ...@@ -378,6 +379,10 @@ func (a *action) unBindOp(cmd *pt.ParaBindMinerCmd) (*types.Receipt, error) {
return nil, errors.Wrapf(types.ErrNotAllow, "unBindOp unbind time=%d less %d hours than bind time =%d", a.blocktime, unBindHours, acct.BlockTime) return nil, errors.Wrapf(types.ErrNotAllow, "unBindOp unbind time=%d less %d hours than bind time =%d", a.blocktime, unBindHours, acct.BlockTime)
} }
if acct.BindStatus != opBind {
return nil, errors.Wrapf(types.ErrNotAllow, "unBindOp,current addr is unbind status")
}
//unfrozen //unfrozen
receipt, err := a.coinsAccount.ExecActive(a.fromaddr, a.execaddr, acct.BindCoins*types.Coin) receipt, err := a.coinsAccount.ExecActive(a.fromaddr, a.execaddr, acct.BindCoins*types.Coin)
if err != nil { if err != nil {
......
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