From f2386f0acf1dc50740af1513bd1f42830117a894 Mon Sep 17 00:00:00 2001 From: Overtorment Date: Mon, 21 Jan 2019 14:18:09 +0000 Subject: [PATCH] REF: retry --- class/User.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/class/User.js b/class/User.js index 88de2ba..dfd364d 100644 --- a/class/User.js +++ b/class/User.js @@ -249,6 +249,10 @@ export class User { */ async getTxs() { let addr = await this.getAddress(); + if (!addr) { + await this.generateAddress(); + addr = await this.getAddress(); + } if (!addr) throw new Error('cannot get transactions: no onchain address assigned to user'); let txs = await this._bitcoindrpc.request('listtransactions', [addr, 100500, 0, true]); txs = txs.result; @@ -289,6 +293,10 @@ export class User { */ async getPendingTxs() { let addr = await this.getAddress(); + if (!addr) { + await this.generateAddress(); + addr = await this.getAddress(); + } if (!addr) throw new Error('cannot get transactions: no onchain address assigned to user'); let txs = await this._bitcoindrpc.request('listtransactions', [addr, 100500, 0, true]); txs = txs.result;