@@ -36,17 +36,10 @@ export const grpc = new GrpcAction(store, ipc);
3636export const notify = new NotificationAction ( store , nav ) ;
3737export const wallet = new WalletAction ( store , grpc , db , nav , notify ) ;
3838export const info = new InfoAction ( store , grpc , nav , notify ) ;
39- export const transaction = new TransactionAction ( store , grpc , wallet , nav ) ;
40- export const channel = new ChannelAction ( store , grpc , transaction , nav , notify ) ;
41- export const invoice = new InvoiceAction (
42- store ,
43- grpc ,
44- transaction ,
45- nav ,
46- notify ,
47- Clipboard
48- ) ;
49- export const payment = new PaymentAction ( store , grpc , transaction , nav , notify ) ;
39+ export const transaction = new TransactionAction ( store , grpc , nav ) ;
40+ export const channel = new ChannelAction ( store , grpc , nav , notify ) ;
41+ export const invoice = new InvoiceAction ( store , grpc , nav , notify , Clipboard ) ;
42+ export const payment = new PaymentAction ( store , grpc , nav , notify ) ;
5043export const setting = new SettingAction ( store , wallet , db , ipc ) ;
5144
5245payment . listenForUrl ( ipc ) ; // enable incoming url handler
@@ -94,11 +87,22 @@ observe(store, 'walletUnlocked', async () => {
9487 * to and from lnd can be done. The display the current state of the
9588 * lnd node all balances, channels and transactions are fetched.
9689 */
97- observe ( store , 'lndReady' , ( ) => {
98- info . getInfo ( ) ;
99- wallet . update ( ) ;
90+ observe ( store , 'lndReady' , async ( ) => {
91+ // TODO: this is a workaround the deadlock bug in lnd that blocks
92+ // calling NewAddress while netrino is syncing.
93+ if ( store . firstStart ) {
94+ // only fetch address before neutrino sync on first start
95+ wallet . getNewAddress ( ) ;
96+ }
97+ wallet . pollBalances ( ) ;
98+ wallet . pollExchangeRate ( ) ;
10099 channel . update ( ) ;
101100 transaction . update ( ) ;
102101 transaction . subscribeTransactions ( ) ;
103102 transaction . subscribeInvoices ( ) ;
103+ await info . pollInfo ( ) ;
104+ if ( ! store . firstStart ) {
105+ // wait until neutrino is synced on second start
106+ wallet . getNewAddress ( ) ;
107+ }
104108} ) ;
0 commit comments