Skip to content

Commit

Permalink
perf(poll)!: avoid extra transaction info request to node
Browse files Browse the repository at this point in the history
  • Loading branch information
davidyuk committed Jan 24, 2022
1 parent e7f8c3d commit 22c4838
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/chain/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ async function topBlock () {
async function poll (th, { blocks = 10, interval = this._getPollInterval('microblock') } = {}) {
const max = await this.height() + blocks
do {
const tx = await this.tx(th)
const tx = await this.api.getTransactionByHash(th)
if (tx.blockHeight !== -1) return tx
await pause(interval)
} while (await this.height() < max)
Expand Down

0 comments on commit 22c4838

Please sign in to comment.