Skip to content

Commit

Permalink
make call to showAccounts async
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcook1186 committed Nov 7, 2022
1 parent adc44ff commit c1dbc02
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions signer/core/cliui.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ func (ui *CommandlineUI) OnApprovedTx(tx ethapi.SignTransactionResult) {
}
}

func (ui *CommandlineUI) ShowAccounts() string {
func (ui *CommandlineUI) showAccounts() string {
accounts, err := ui.api.ListAccounts(context.Background())
if err != nil {
fmt.Print("error listing accounts", err)
Expand All @@ -264,8 +264,10 @@ func (ui *CommandlineUI) ShowAccounts() string {
}

func (ui *CommandlineUI) OnSignerStartup(info StartupInfo) {
addresses := ui.ShowAccounts()
fmt.Printf("%s", addresses)
go func() {
addresses := ui.showAccounts()
fmt.Printf("%s", addresses)
}()
fmt.Printf("\n------- Signer info -------\n")
for k, v := range info.Info {
fmt.Printf("* %v : %v\n", k, v)
Expand Down

0 comments on commit c1dbc02

Please sign in to comment.