Skip to content

Commit

Permalink
LND coin control: handle error on publish tx
Browse files Browse the repository at this point in the history
  • Loading branch information
kaloudis committed Apr 1, 2024
1 parent c95aaaf commit a772ec1
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions stores/TransactionsStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,16 @@ export default class TransactionsStore {
BackendUtils.publishTransaction({
tx_hex: raw_final_tx
})
.then(() => {
this.txid = txid;
this.publishSuccess = true;
this.loading = false;
.then((data: any) => {
if (data.publish_error) {
this.error_msg = data.publish_error;
this.error = true;
this.loading = false;
} else {
this.txid = txid;
this.publishSuccess = true;
this.loading = false;
}
})
.catch((error: any) => {
// handle error
Expand Down

0 comments on commit a772ec1

Please sign in to comment.