1
This commit is contained in:
parent
99f98c0c9f
commit
a209eaf56b
@ -14,6 +14,7 @@ class PullBcEvent extends BaseService {
|
||||
this.bc = bc;
|
||||
this.net = net;
|
||||
this.event = event;
|
||||
this.eventConf = this.event['eventConf'];
|
||||
await this.start();
|
||||
}
|
||||
|
||||
@ -83,14 +84,15 @@ class PullBcEvent extends BaseService {
|
||||
|
||||
async getFromBlock() {
|
||||
const logClass = this.getInstanceName() + ' getFromBlock:';
|
||||
const firstBlockNumber = this.event['eventConf']['init_block'];
|
||||
const firstBlockNumber = this.getInitBlock();
|
||||
while (this.lastBlockNumber < 1) {
|
||||
try {
|
||||
const {err, row} = await this.conn.ormSelectOne(
|
||||
't_last_block',
|
||||
[
|
||||
['net_id', this.getNetId()],
|
||||
['address', this.getNetId()]
|
||||
['address', this.getContractAddress()],
|
||||
['event_name', this.getEventName()],
|
||||
]
|
||||
);
|
||||
if (!err) {
|
||||
@ -195,6 +197,18 @@ class PullBcEvent extends BaseService {
|
||||
return this.net['net_id'];
|
||||
}
|
||||
|
||||
getEventName() {
|
||||
return this.eventConf['event_name'];
|
||||
}
|
||||
|
||||
getInitBlock() {
|
||||
return this.eventConf['init_block'];
|
||||
}
|
||||
|
||||
getContractAddress() {
|
||||
return '';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = PullBcEvent;
|
||||
|
Loading…
x
Reference in New Issue
Block a user