Skip to content

Commit

Permalink
lnv3: add request withdraw liquidity time
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoch05 committed Feb 18, 2024
1 parent c99a8c6 commit 5d54a9a
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions apollo/src/lnv3/lnv3.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,19 +259,18 @@ export class Lnv3Service implements OnModuleInit {
variables: null,
})
.then((res) => res.data?.data?.lnv3TransferRecord);
if (transferRecord) {
if (transferRecord && (transferRecord.hasWithdrawn || record.lastRequestWithdraw < requestWithdrawTimestamp)) {
await this.aggregationService.updateHistoryRecord({
where: { id: record.id },
data: {
needWithdrawLiquidity: !transferRecord.hasWithdrawn,
endTxHash: transferRecord.responseTxHash,
lastRequestWithdraw: requestWithdrawTimestamp,
},
});
if (transferRecord.hasWithdrawn) {
this.logger.log(
`lnv3 [${transfer.chain}->${toChain.chain}] tx withdrawn id: ${record.id}`
);
}
this.logger.log(
`lnv3 [${transfer.chain}->${toChain.chain}] tx withdrawn id: ${record.id}, time: ${requestWithdrawTimestamp}, done: ${transferRecord.hasWithdrawn}`
);
}
}
}
Expand Down

0 comments on commit 5d54a9a

Please sign in to comment.