multi-account: add forEachKeyScope uitility iterator
This commit is contained in:
parent
169abd446c
commit
00c29c3936
1 changed files with 14 additions and 0 deletions
|
@ -2110,3 +2110,17 @@ func decodeHexStr(hexStr string) ([]byte, error) {
|
|||
}
|
||||
return decoded, nil
|
||||
}
|
||||
|
||||
// forEachKeyScope calls the given function with each default key scopes
|
||||
// breaking early on error.
|
||||
func forEachKeyScope(fn func(scope waddrmgr.KeyScope) error) error {
|
||||
|
||||
for _, scope := range waddrmgr.DefaultKeyScopes {
|
||||
err := fn(scope)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue