fix(timer controllers): Wrapper stale order/offer detection in retry-queue

This commit is contained in:
Chris Troutner
2022-10-05 14:50:53 -07:00
parent 5b545aebeb
commit 2047673862
4 changed files with 16 additions and 17 deletions
+9 -10
View File
@@ -9,8 +9,7 @@
"version": "2.0.2",
"license": "MIT",
"dependencies": {
"@chris.troutner/retry-queue": "1.0.5",
"@psf/bch-js": "^6.4.5",
"@chris.troutner/retry-queue": "1.0.8",
"axios": "0.27.2",
"bch-message-lib": "2.2.1",
"bcryptjs": "2.4.3",
@@ -32,7 +31,7 @@
"koa-router": "10.0.0",
"koa-static": "5.0.0",
"koa2-ratelimit": "0.9.1",
"libp2p": "^0.36.2",
"libp2p": "0.36.2",
"line-reader": "0.4.0",
"minimal-slp-wallet": "5.2.1",
"mongoose": "5.13.14",
@@ -40,7 +39,7 @@
"nodemailer": "6.7.5",
"p2wdb": "2.2.3",
"passport-local": "1.0.0",
"public-ip": "^4.0.4",
"public-ip": "4.0.4",
"winston": "3.3.3",
"winston-daily-rotate-file": "4.5.0"
},
@@ -173,9 +172,9 @@
}
},
"node_modules/@chris.troutner/retry-queue": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/@chris.troutner/retry-queue/-/retry-queue-1.0.5.tgz",
"integrity": "sha512-autE5GRCXR0xgPqq6qIq1sbUw8j2btxCWlezSvpRJmPVQQZwGhYbeF7euxRbpMmi31kj47iHgG7sb45bD0HY7Q==",
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/@chris.troutner/retry-queue/-/retry-queue-1.0.8.tgz",
"integrity": "sha512-ucyUGWTeXhOcXLglwb8alR3dNATPy+3vGea2uQJ0J8jnJufWrUr/NEq4b53op1tOTF029qrun6OmIN6Ls58pqw==",
"dependencies": {
"p-queue": "7.3.0",
"p-retry": "5.1.1"
@@ -15753,9 +15752,9 @@
}
},
"@chris.troutner/retry-queue": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/@chris.troutner/retry-queue/-/retry-queue-1.0.5.tgz",
"integrity": "sha512-autE5GRCXR0xgPqq6qIq1sbUw8j2btxCWlezSvpRJmPVQQZwGhYbeF7euxRbpMmi31kj47iHgG7sb45bD0HY7Q==",
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/@chris.troutner/retry-queue/-/retry-queue-1.0.8.tgz",
"integrity": "sha512-ucyUGWTeXhOcXLglwb8alR3dNATPy+3vGea2uQJ0J8jnJufWrUr/NEq4b53op1tOTF029qrun6OmIN6Ls58pqw==",
"requires": {
"p-queue": "7.3.0",
"p-retry": "5.1.1"
+3 -4
View File
@@ -28,8 +28,7 @@
},
"repository": "Permissionless-Software-Foundation/bch-dex",
"dependencies": {
"@chris.troutner/retry-queue": "1.0.5",
"@psf/bch-js": "^6.4.5",
"@chris.troutner/retry-queue": "1.0.8",
"axios": "0.27.2",
"bch-message-lib": "2.2.1",
"bcryptjs": "2.4.3",
@@ -51,7 +50,7 @@
"koa-router": "10.0.0",
"koa-static": "5.0.0",
"koa2-ratelimit": "0.9.1",
"libp2p": "^0.36.2",
"libp2p": "0.36.2",
"line-reader": "0.4.0",
"minimal-slp-wallet": "5.2.1",
"mongoose": "5.13.14",
@@ -59,7 +58,7 @@
"nodemailer": "6.7.5",
"p2wdb": "2.2.3",
"passport-local": "1.0.0",
"public-ip": "^4.0.4",
"public-ip": "4.0.4",
"winston": "3.3.3",
"winston-daily-rotate-file": "4.5.0"
},
+2 -2
View File
@@ -83,7 +83,6 @@ class OfferUseCases {
}
// const utxoStatus = await this.adapters.wallet.bchWallet.utxoIsValid(utxo)
const utxoStatus = await this.retryQueue.addToQueue(this.adapters.wallet.bchWallet.utxoIsValid, utxo)
console.log('utxoStatus: ', utxoStatus)
// if (utxoStatus === null) return false
if (!utxoStatus) return false
@@ -562,7 +561,8 @@ class OfferUseCases {
}
// console.log(`Checking this UTXO: ${JSON.stringify(utxo, null, 2)}`)
utxoStatus = await this.adapters.wallet.bchWallet.utxoIsValid(utxo)
// utxoStatus = await this.adapters.wallet.bchWallet.utxoIsValid(utxo)
utxoStatus = await this.retryQueue.addToQueue(this.adapters.wallet.bchWallet.utxoIsValid, utxo)
// console.log('utxoStatus: ', utxoStatus)
} catch (err) {
// Handle corner case of bad-data in the Offer model.
+2 -1
View File
@@ -216,7 +216,8 @@ class OrderLib {
tx_hash: thisOrder.utxoTxid,
tx_pos: thisOrder.utxoVout
}
utxoStatus = await this.adapters.wallet.bchWallet.utxoIsValid(utxo)
// utxoStatus = await this.adapters.wallet.bchWallet.utxoIsValid(utxo)
utxoStatus = await this.retryQueue.addToQueue(this.adapters.wallet.bchWallet.utxoIsValid, utxo)
// console.log('utxoStatus: ', utxoStatus)
} catch (err) {
// Handle corner case of bad-data in the Order model.