@ -191,13 +191,7 @@ func NewPublicAccountAPI(am *accounts.Manager) *PublicAccountAPI {
// Accounts returns the collection of accounts this node manages
// Accounts returns the collection of accounts this node manages
func ( s * PublicAccountAPI ) Accounts ( ) [ ] common . Address {
func ( s * PublicAccountAPI ) Accounts ( ) [ ] common . Address {
addresses := make ( [ ] common . Address , 0 ) // return [] instead of nil if empty
return s . am . Accounts ( )
for _ , wallet := range s . am . Wallets ( ) {
for _ , account := range wallet . Accounts ( ) {
addresses = append ( addresses , account . Address )
}
}
return addresses
}
}
// PrivateAccountAPI provides an API to access accounts managed by this node.
// PrivateAccountAPI provides an API to access accounts managed by this node.
@ -220,13 +214,7 @@ func NewPrivateAccountAPI(b Backend, nonceLock *AddrLocker) *PrivateAccountAPI {
// listAccounts will return a list of addresses for accounts this node manages.
// listAccounts will return a list of addresses for accounts this node manages.
func ( s * PrivateAccountAPI ) ListAccounts ( ) [ ] common . Address {
func ( s * PrivateAccountAPI ) ListAccounts ( ) [ ] common . Address {
addresses := make ( [ ] common . Address , 0 ) // return [] instead of nil if empty
return s . am . Accounts ( )
for _ , wallet := range s . am . Wallets ( ) {
for _ , account := range wallet . Accounts ( ) {
addresses = append ( addresses , account . Address )
}
}
return addresses
}
}
// rawWallet is a JSON representation of an accounts.Wallet interface, with its
// rawWallet is a JSON representation of an accounts.Wallet interface, with its