permission: changed to pass the exact error message based on checkAccount response

This commit is contained in:
vsmk98 2019-08-14 14:28:30 +08:00
parent 01f4e9b131
commit 1f0da48be6
1 changed files with 2 additions and 2 deletions

View File

@ -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 {