|
|
@@ -87,11 +87,11 @@ export class LpGenerate {
|
|
|
} catch (e) {}
|
|
|
}
|
|
|
|
|
|
- async saveLp(lp: any, type='0') {
|
|
|
+ async saveLp(lp: any, hash: string, type='0') {
|
|
|
// 本地lp实例存档
|
|
|
- this.lpInstance[lp.LP.toLowerCase()] = lp
|
|
|
+ this.lpInstance[hash] = lp
|
|
|
|
|
|
- await History.appendOrUpdate(type, lp.LP, lp)
|
|
|
+ await History.appendOrUpdate(type, hash, lp)
|
|
|
}
|
|
|
|
|
|
parseFactory(router: any, factoryAbi: any, factoryAddress: string) {
|
|
|
@@ -106,13 +106,13 @@ export class LpGenerate {
|
|
|
if (lp) {
|
|
|
logger.debug(`new lp: ${hash}. ${now}/${max}`)
|
|
|
// 2. 保存Lp信息
|
|
|
- await this.saveLp(lp, 'lp')
|
|
|
+ await this.saveLp(lp, hash, 'lp')
|
|
|
// 3. 保存Lp的Token到Token表
|
|
|
await this.saveToken(lp, 'token')
|
|
|
} else {
|
|
|
logger.debug(`not lp: ${hash}. ${now}/${max}`)
|
|
|
// 4. 非lp放到非lp类型
|
|
|
- await this.saveLp(lp, 'notLp')
|
|
|
+ await this.saveLp(lp, hash, 'notLp')
|
|
|
}
|
|
|
}
|
|
|
|