File tree Expand file tree Collapse file tree 4 files changed +7
-6
lines changed
bitbox02bootloader/assets Expand file tree Collapse file tree 4 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -750,12 +750,16 @@ func (backend *Backend) addAccount(account accounts.Interface) {
750
750
})
751
751
if event .Subject == string (accountsTypes .EventSyncDone ) {
752
752
backend .notifyNewTxs (account )
753
+ go backend .checkAccountUsed (account )
753
754
}
754
755
})
756
+ if err := account .Initialize (); err != nil {
757
+ backend .log .WithError (err ).Error ("error initializing account" )
758
+ return
759
+ }
755
760
if backend .onAccountInit != nil {
756
761
backend .onAccountInit (account )
757
762
}
758
- go backend .checkAccountUsed (account )
759
763
}
760
764
761
765
// The accountsAndKeystoreLock must be held when calling this function.
@@ -1529,10 +1533,6 @@ func (backend *Backend) checkAccountUsed(account accounts.Interface) {
1529
1533
}
1530
1534
}
1531
1535
log := backend .log .WithField ("accountCode" , account .Config ().Config .Code )
1532
- if err := account .Initialize (); err != nil {
1533
- log .WithError (err ).Error ("error initializing account" )
1534
- return
1535
- }
1536
1536
txs , err := account .Transactions ()
1537
1537
if err != nil {
1538
1538
log .WithError (err ).Error ("discoverAccount" )
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ import (
22
22
"net/url"
23
23
"os"
24
24
"path/filepath"
25
+ "slices"
25
26
"strings"
26
27
"time"
27
28
@@ -590,7 +591,7 @@ func (backend *Backend) Testing() bool {
590
591
// Accounts returns the current accounts of the backend.
591
592
func (backend * Backend ) Accounts () AccountsList {
592
593
defer backend .accountsAndKeystoreLock .RLock ()()
593
- return backend .accounts
594
+ return slices . Clone ( backend .accounts )
594
595
}
595
596
596
597
// KeystoreTotalAmount represents the total balance amount of the accounts belonging to a keystore.
You can’t perform that action at this time.
0 commit comments