|
|
@ -133,7 +133,7 @@ export class TxListener { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
init () { |
|
|
|
init () { |
|
|
|
this.blocks = [] |
|
|
|
this.blocks = [] |
|
|
|
this.lastBlock = null |
|
|
|
this.lastBlock = -1 |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -170,8 +170,7 @@ export class TxListener { |
|
|
|
this.executionContext.web3().eth.getBlockNumber((error, blockNumber) => { |
|
|
|
this.executionContext.web3().eth.getBlockNumber((error, blockNumber) => { |
|
|
|
if (this._loopId === null) return |
|
|
|
if (this._loopId === null) return |
|
|
|
if (error) return console.log(error) |
|
|
|
if (error) return console.log(error) |
|
|
|
if (currentLoopId === this._loopId && (!this.lastBlock || blockNumber > this.lastBlock)) { |
|
|
|
if (currentLoopId === this._loopId && blockNumber > this.lastBlock) { |
|
|
|
if (!this.lastBlock) this.lastBlock = blockNumber - 1 |
|
|
|
|
|
|
|
let current = this.lastBlock + 1 |
|
|
|
let current = this.lastBlock + 1 |
|
|
|
this.lastBlock = blockNumber |
|
|
|
this.lastBlock = blockNumber |
|
|
|
while (blockNumber >= current) { |
|
|
|
while (blockNumber >= current) { |
|
|
|