Skip to content

Commit

Permalink
adding register processor
Browse files Browse the repository at this point in the history
coinchimp committed Aug 4, 2024
1 parent f5edd27 commit e5e6f61
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/trxs/index.ts
Original file line number Diff line number Diff line change
@@ -25,6 +25,7 @@ export default class trxManager {
if (DEBUG) this.monitoring.debug(`TrxManager: Pool Address: ${this.address}`);
this.processor = new UtxoProcessor({ rpc, networkId });
this.context = new UtxoContext({ processor: this.processor });
this.registerProcessor()
}

async init() {
@@ -75,7 +76,14 @@ export default class trxManager {
if (DEBUG) this.monitoring.debug(`TrxManager: Payment with ransaction ID: ${transaction.id} submitted`);
await new Promise(resolve => setTimeout(resolve, 5000)); // 5-second delay
}

if (DEBUG) this.monitoring.debug(`TrxManager: summary.finalTransactionId: ${summary.finalTransactionId}`);
return summary.finalTransactionId;
}
private registerProcessor () {
this.processor.addEventListener("utxo-proc-start", async () => {
await this.context.clear()
await this.context.trackAddresses([ this.address ])
})
this.processor.start()
}
}

0 comments on commit e5e6f61

Please sign in to comment.