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
9cddd298
Commit
9cddd298
authored
Apr 26, 2019
by
mdj33
Committed by
vipwzw
May 05, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding node not check nodegroup status
parent
978fa4d4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
14 deletions
+18
-14
superaccount.go
plugin/dapp/paracross/executor/superaccount.go
+18
-14
No files found.
plugin/dapp/paracross/executor/superaccount.go
View file @
9cddd298
...
@@ -191,20 +191,7 @@ func (a *action) nodeJoin(config *pt.ParaNodeAddrConfig) (*types.Receipt, error)
...
@@ -191,20 +191,7 @@ func (a *action) nodeJoin(config *pt.ParaNodeAddrConfig) (*types.Receipt, error)
}
}
func
(
a
*
action
)
nodeQuit
(
config
*
pt
.
ParaNodeAddrConfig
)
(
*
types
.
Receipt
,
error
)
{
func
(
a
*
action
)
nodeQuit
(
config
*
pt
.
ParaNodeAddrConfig
)
(
*
types
.
Receipt
,
error
)
{
key
:=
calcParaNodeGroupKey
(
config
.
Title
)
key
:=
calcParaNodeAddrKey
(
config
.
Title
,
config
.
Addr
)
nodes
,
_
,
err
:=
getNodes
(
a
.
db
,
key
)
if
err
!=
nil
{
return
nil
,
errors
.
Wrapf
(
err
,
"getNodes for title:%s"
,
config
.
Title
)
}
if
!
validNode
(
a
.
fromaddr
,
nodes
)
{
return
nil
,
errors
.
Wrapf
(
pt
.
ErrParaNodeAddrNotExisted
,
"nodeAddr not existed:%s"
,
a
.
fromaddr
)
}
//不允许最后一个账户退出
if
len
(
nodes
)
==
1
{
return
nil
,
errors
.
Wrapf
(
pt
.
ErrParaNodeGroupLastAddr
,
"nodeAddr last one:%s"
,
a
.
fromaddr
)
}
key
=
calcParaNodeAddrKey
(
config
.
Title
,
config
.
Addr
)
stat
,
err
:=
getNodeAddr
(
a
.
db
,
key
)
stat
,
err
:=
getNodeAddr
(
a
.
db
,
key
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
...
@@ -214,6 +201,23 @@ func (a *action) nodeQuit(config *pt.ParaNodeAddrConfig) (*types.Receipt, error)
...
@@ -214,6 +201,23 @@ func (a *action) nodeQuit(config *pt.ParaNodeAddrConfig) (*types.Receipt, error)
clog
.
Error
(
"nodeaccount.nodeQuit wrong status"
,
"key"
,
string
(
key
),
"status"
,
stat
)
clog
.
Error
(
"nodeaccount.nodeQuit wrong status"
,
"key"
,
string
(
key
),
"status"
,
stat
)
return
nil
,
errors
.
Wrapf
(
pt
.
ErrParaUnSupportNodeOper
,
"nodeAddr %s was quit status:%d"
,
a
.
fromaddr
,
stat
.
Status
)
return
nil
,
errors
.
Wrapf
(
pt
.
ErrParaUnSupportNodeOper
,
"nodeAddr %s was quit status:%d"
,
a
.
fromaddr
,
stat
.
Status
)
}
}
if
stat
.
Status
==
pt
.
ParacrossNodeAdded
{
key
=
calcParaNodeGroupKey
(
config
.
Title
)
nodes
,
_
,
err
:=
getNodes
(
a
.
db
,
key
)
if
err
!=
nil
{
return
nil
,
errors
.
Wrapf
(
err
,
"getNodes for title:%s"
,
config
.
Title
)
}
if
!
validNode
(
a
.
fromaddr
,
nodes
){
return
nil
,
errors
.
Wrapf
(
pt
.
ErrParaNodeAddrNotExisted
,
"nodeAddr not existed:%s"
,
a
.
fromaddr
)
}
//不允许最后一个账户退出
if
len
(
nodes
)
==
1
{
return
nil
,
errors
.
Wrapf
(
pt
.
ErrParaNodeGroupLastAddr
,
"nodeAddr last one:%s"
,
a
.
fromaddr
)
}
}
var
copyStat
pt
.
ParaNodeAddrStatus
var
copyStat
pt
.
ParaNodeAddrStatus
err
=
deepCopy
(
&
copyStat
,
stat
)
err
=
deepCopy
(
&
copyStat
,
stat
)
if
err
!=
nil
{
if
err
!=
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