REF: retry
This commit is contained in:
parent
ff2d98dc10
commit
f2386f0acf
@ -249,6 +249,10 @@ export class User {
|
|||||||
*/
|
*/
|
||||||
async getTxs() {
|
async getTxs() {
|
||||||
let addr = await this.getAddress();
|
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');
|
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]);
|
let txs = await this._bitcoindrpc.request('listtransactions', [addr, 100500, 0, true]);
|
||||||
txs = txs.result;
|
txs = txs.result;
|
||||||
@ -289,6 +293,10 @@ export class User {
|
|||||||
*/
|
*/
|
||||||
async getPendingTxs() {
|
async getPendingTxs() {
|
||||||
let addr = await this.getAddress();
|
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');
|
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]);
|
let txs = await this._bitcoindrpc.request('listtransactions', [addr, 100500, 0, true]);
|
||||||
txs = txs.result;
|
txs = txs.result;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user