diff --git a/backends/LND.ts b/backends/LND.ts index 9996cd3651..167af854df 100644 --- a/backends/LND.ts +++ b/backends/LND.ts @@ -674,7 +674,7 @@ export default class LND { supportsCoinControl = () => this.supports('v0.12.0'); supportsChannelCoinControl = () => this.supports('v0.17.0'); supportsHopPicking = () => this.supports('v0.11.0'); - supportsAccounts = () => this.supports('v0.18.3'); + supportsAccounts = () => this.supports('v0.13.0'); supportsRouting = () => true; supportsNodeInfo = () => true; singleFeesEarnedTotal = () => false; diff --git a/backends/LightningNodeConnect.ts b/backends/LightningNodeConnect.ts index 39295c4b68..9eb41f8a54 100644 --- a/backends/LightningNodeConnect.ts +++ b/backends/LightningNodeConnect.ts @@ -512,7 +512,7 @@ export default class LightningNodeConnect { supportsChannelCoinControl = () => this.permNewAddress && this.supports('v0.17.0'); supportsHopPicking = () => this.permOpenChannel; - supportsAccounts = () => this.permImportAccount && this.supports('v0.18.3'); + supportsAccounts = () => this.permImportAccount; supportsRouting = () => this.permForwardingHistory; supportsNodeInfo = () => true; singleFeesEarnedTotal = () => false; diff --git a/stores/TransactionsStore.ts b/stores/TransactionsStore.ts index 21c3bab2f2..20708b0b50 100644 --- a/stores/TransactionsStore.ts +++ b/stores/TransactionsStore.ts @@ -169,12 +169,12 @@ export default class TransactionsStore { @action public finalizePsbtAndBroadcast = ( funded_psbt: string, - backwardsCompat?: boolean + defaultAccount?: boolean ) => { this.funded_psbt = ''; this.loading = true; - if (backwardsCompat) { + if (defaultAccount) { return BackendUtils.finalizePsbt({ funded_psbt }) .then((data: any) => { const raw_final_tx = data.raw_final_tx; @@ -306,7 +306,8 @@ export default class TransactionsStore { }; public sendCoinsLNDCoinControl = ( - transactionRequest: TransactionRequest + transactionRequest: TransactionRequest, + defaultAccount?: boolean ) => { const { utxos, @@ -357,10 +358,7 @@ export default class TransactionsStore { this.funded_psbt = funded_psbt; this.loading = false; } else { - this.finalizePsbtAndBroadcast( - funded_psbt, - !BackendUtils.supportsAccounts() - ); + this.finalizePsbtAndBroadcast(funded_psbt, defaultAccount); } }) .catch((error: any) => { @@ -406,7 +404,10 @@ export default class TransactionsStore { (transactionRequest?.additional_outputs?.length && transactionRequest?.additional_outputs?.length > 0) ) { - return this.sendCoinsLNDCoinControl(transactionRequest); + return this.sendCoinsLNDCoinControl( + transactionRequest, + transactionRequest.account === 'default' + ); } this.crafting = false;