mirror of https://github.com/poanetwork/quorum.git
permission: changed to pass the exact error message based on checkAccount response
This commit is contained in:
parent
01f4e9b131
commit
1f0da48be6
|
@ -650,7 +650,7 @@ func (pool *TxPool) validateTx(tx *types.Transaction, local bool) error {
|
|||
// Check if the sender account is authorized to perform the transaction
|
||||
if isQuorum {
|
||||
if err := checkAccount(from, tx.To()); err != nil {
|
||||
return ErrUnAuthorizedAccount
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1330,7 +1330,7 @@ func checkAccount(fromAcct common.Address, toAcct *common.Address) error {
|
|||
return nil
|
||||
|
||||
case types.ReadOnly:
|
||||
return errors.New("account does not have transaction permissions")
|
||||
return errors.New("read only account. cannot transact")
|
||||
|
||||
case types.Transact:
|
||||
if toAcct == nil {
|
||||
|
|
Loading…
Reference in New Issue