@@ -84,10 +84,7 @@ func (w *keystoreWallet) SelfDerive(base accounts.DerivationPath, chain ethereum
84
84
// able to sign via our shared keystore backend).
85
85
func (w * keystoreWallet ) SignHash (account accounts.Account , hash []byte ) ([]byte , error ) {
86
86
// Make sure the requested account is contained within
87
- if account .Address != w .account .Address {
88
- return nil , accounts .ErrUnknownAccount
89
- }
90
- if account .URL != (accounts.URL {}) && account .URL != w .account .URL {
87
+ if ! w .Contains (account ) {
91
88
return nil , accounts .ErrUnknownAccount
92
89
}
93
90
// Account seems valid, request the keystore to sign
@@ -100,10 +97,7 @@ func (w *keystoreWallet) SignHash(account accounts.Account, hash []byte) ([]byte
100
97
// be able to sign via our shared keystore backend).
101
98
func (w * keystoreWallet ) SignTx (account accounts.Account , tx * types.Transaction , chainID * big.Int ) (* types.Transaction , error ) {
102
99
// Make sure the requested account is contained within
103
- if account .Address != w .account .Address {
104
- return nil , accounts .ErrUnknownAccount
105
- }
106
- if account .URL != (accounts.URL {}) && account .URL != w .account .URL {
100
+ if ! w .Contains (account ) {
107
101
return nil , accounts .ErrUnknownAccount
108
102
}
109
103
// Account seems valid, request the keystore to sign
@@ -114,10 +108,7 @@ func (w *keystoreWallet) SignTx(account accounts.Account, tx *types.Transaction,
114
108
// given hash with the given account using passphrase as extra authentication.
115
109
func (w * keystoreWallet ) SignHashWithPassphrase (account accounts.Account , passphrase string , hash []byte ) ([]byte , error ) {
116
110
// Make sure the requested account is contained within
117
- if account .Address != w .account .Address {
118
- return nil , accounts .ErrUnknownAccount
119
- }
120
- if account .URL != (accounts.URL {}) && account .URL != w .account .URL {
111
+ if ! w .Contains (account ) {
121
112
return nil , accounts .ErrUnknownAccount
122
113
}
123
114
// Account seems valid, request the keystore to sign
@@ -128,10 +119,7 @@ func (w *keystoreWallet) SignHashWithPassphrase(account accounts.Account, passph
128
119
// transaction with the given account using passphrase as extra authentication.
129
120
func (w * keystoreWallet ) SignTxWithPassphrase (account accounts.Account , passphrase string , tx * types.Transaction , chainID * big.Int ) (* types.Transaction , error ) {
130
121
// Make sure the requested account is contained within
131
- if account .Address != w .account .Address {
132
- return nil , accounts .ErrUnknownAccount
133
- }
134
- if account .URL != (accounts.URL {}) && account .URL != w .account .URL {
122
+ if ! w .Contains (account ) {
135
123
return nil , accounts .ErrUnknownAccount
136
124
}
137
125
// Account seems valid, request the keystore to sign
0 commit comments