Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
8a798360
Unverified
Commit
8a798360
authored
Nov 20, 2017
by
Péter Szilágyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
accounts: list, then subscribe (sub requires active reader)
parent
f5091e57
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
manager.go
accounts/manager.go
+5
-5
No files found.
accounts/manager.go
View file @
8a798360
...
...
@@ -41,6 +41,11 @@ type Manager struct {
// NewManager creates a generic account manager to sign transaction via various
// supported backends.
func
NewManager
(
backends
...
Backend
)
*
Manager
{
// Retrieve the initial list of wallets from the backends and sort by URL
var
wallets
[]
Wallet
for
_
,
backend
:=
range
backends
{
wallets
=
merge
(
wallets
,
backend
.
Wallets
()
...
)
}
// Subscribe to wallet notifications from all backends
updates
:=
make
(
chan
WalletEvent
,
4
*
len
(
backends
))
...
...
@@ -48,11 +53,6 @@ func NewManager(backends ...Backend) *Manager {
for
i
,
backend
:=
range
backends
{
subs
[
i
]
=
backend
.
Subscribe
(
updates
)
}
// Retrieve the initial list of wallets from the backends and sort by URL
var
wallets
[]
Wallet
for
_
,
backend
:=
range
backends
{
wallets
=
merge
(
wallets
,
backend
.
Wallets
()
...
)
}
// Assemble the account manager and return
am
:=
&
Manager
{
backends
:
make
(
map
[
reflect
.
Type
][]
Backend
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment