Skip to content

Commit

Permalink
Merge pull request #1080 from aeternity/feature/refactor-height-query
Browse files Browse the repository at this point in the history
Refactor height query
  • Loading branch information
mradkov authored Oct 26, 2020
2 parents 8e872b4 + b013bf9 commit 139ff8a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions es/chain/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,12 @@ async function tx (hash, info = true) {

async function height () {
try {
if (this.height_query_promise === undefined) {
this.height_query_promise = this.api.getCurrentKeyBlockHeight()
if (!this._heightPromise) {
this._heightPromise = this.api.getCurrentKeyBlockHeight()
}
return (await this.height_query_promise).height
return (await this._heightPromise).height
} finally {
this.height_query_promise = undefined
delete this._heightPromise
}
}

Expand Down

0 comments on commit 139ff8a

Please sign in to comment.