fatal error if a node joins permissioned network in non permissioned mode

This commit is contained in:
vsmk98 2018-11-15 13:23:59 +08:00
parent 9eaace0990
commit 4bcae7bd9b
3 changed files with 11 additions and 10 deletions

View File

@ -62,7 +62,8 @@ func NewKeyedTransactor(key *ecdsa.PrivateKey) *TransactOpts {
}
}
// NewWalletTransactor is a utility method to easily create a transaction signer
// from a wallet account
func NewWalletTransactor(w accounts.Wallet, from accounts.Account) *TransactOpts {
return &TransactOpts{
From: from.Address,
@ -74,4 +75,4 @@ func NewWalletTransactor(w accounts.Wallet, from accounts.Account) *TransactOpts
return tx.WithSignature(signer, signature)
},
}
}
}

View File

@ -426,7 +426,7 @@ func (p *PermissionCtrl) populateInitPermission() error {
if tx && !p.permissionedMode {
// Network is initialized with permissions and node is joining in a non-permissioned
// option. stop the node from coming up
types.SetDefaultAccess()
utils.Fatalf("Joining a permissioned network in non-permissioned mode. Bring up get with --permissioned.")
}
if !p.permissionedMode{
@ -442,7 +442,7 @@ func (p *PermissionCtrl) populateInitPermission() error {
// populate the initial node list from static-nodes.json
err := p.populateStaticNodesToContract(permissionsSession)
if err != nil {
return err
return err
}
// update network status to boot completed

View File

@ -48,12 +48,12 @@ func GetAcctAccess(acctId common.Address) AccessType {
return vo.AcctAccess
}
}
return DefaultAccess
// if AcctMap.Len() == 0 {
// return FullAccess
// } else {
// return ReadOnly
// }
// return DefaultAccess
if AcctMap.Len() == 0 {
return FullAccess
} else {
return ReadOnly
}
}
func AddOrgKey(orgId string, key string) {