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