Skip to content
This repository was archived by the owner on Feb 23, 2021. It is now read-only.

Commit 046821f

Browse files
committed
Fix workaround to lnd deadlock bug
1 parent f7a2888 commit 046821f

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/action/index.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,21 @@ observe(store, 'walletUnlocked', async () => {
8888
* lnd node all balances, channels and transactions are fetched.
8989
*/
9090
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();
9199
channel.update();
92100
transaction.update();
93101
transaction.subscribeTransactions();
94102
transaction.subscribeInvoices();
95-
wallet.pollBalances();
96-
wallet.pollExchangeRate();
97103
await info.pollInfo();
98-
wallet.getNewAddress(); // wait until neutrino is synced due to deadlock bug
104+
if (!store.firstStart) {
105+
// wait until neutrino is synced on second start
106+
wallet.getNewAddress();
107+
}
99108
});

0 commit comments

Comments
 (0)