1
This commit is contained in:
parent
9fb7e16e14
commit
f906010bee
@ -26,7 +26,10 @@ class Present {
|
||||
|
||||
async mint() {
|
||||
const logClass = 'present.mint';
|
||||
await this.internalMint();
|
||||
const exists = await this.nftExists();
|
||||
if (!exists) {
|
||||
await this.internalMint();
|
||||
}
|
||||
await this.updateDbMustBeSuccess(
|
||||
logClass,
|
||||
[
|
||||
@ -290,6 +293,21 @@ class Present {
|
||||
return utils.getMintInstance(this.presentDb['bc_mint_token_type']);
|
||||
}
|
||||
|
||||
async nftExists() {
|
||||
while (true) {
|
||||
const {err, row} = await dbhelper.ormSelectOne(
|
||||
't_nft',
|
||||
[
|
||||
['token_id', this.getTokenId()]
|
||||
]);
|
||||
if (!err) {
|
||||
return row ? true : false;
|
||||
}
|
||||
await utils.sleep(5000 + utils.randRange(500, 1500));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
exports.Present = Present;
|
||||
|
Loading…
x
Reference in New Issue
Block a user