mirror of
https://github.com/Permissionless-Software-Foundation/bch-dex.git
synced 2026-09-22 01:02:00 -07:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9b775c5bf6 | ||
|
|
2047673862 | ||
|
|
5b545aebeb | ||
|
|
1e75816125 | ||
|
|
455fd807a4 | ||
|
|
8b75ac0f32 | ||
|
|
f1a5ae70e2 |
Generated
+9
-10
@@ -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
@@ -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"
|
||||
},
|
||||
|
||||
@@ -73,7 +73,7 @@ services:
|
||||
#build:
|
||||
# context: ./bch-dex/
|
||||
# dockerfile: Dockerfile
|
||||
image: christroutner/bch-dex:v2.0.6
|
||||
image: christroutner/bch-dex:v2.0.8
|
||||
container_name: bch-dex
|
||||
environment:
|
||||
CONSUMER_URL: 'https://free-bch.fullstack.cash'
|
||||
@@ -97,7 +97,7 @@ services:
|
||||
#build:
|
||||
# context: ./bch-dex-ui/
|
||||
# dockerfile: Dockerfile
|
||||
image: christroutner/bch-dex-ui:v1.12.0
|
||||
image: christroutner/bch-dex-ui:v1.2.4
|
||||
container_name: dex-ui
|
||||
environment:
|
||||
SERVER: 'http://192.168.2.3'
|
||||
|
||||
@@ -70,7 +70,7 @@ services:
|
||||
#build:
|
||||
# context: ./bch-dex/
|
||||
# dockerfile: Dockerfile
|
||||
image: christroutner/bch-dex-rpi:v2.0.6
|
||||
image: christroutner/bch-dex-rpi:v2.0.8
|
||||
container_name: bch-dex
|
||||
environment:
|
||||
#CONSUMER_URL: 'https://free-bch.fullstack.cash'
|
||||
@@ -95,7 +95,7 @@ services:
|
||||
#build:
|
||||
# context: ./bch-dex-ui/
|
||||
# dockerfile: Dockerfile
|
||||
image: christroutner/bch-dex-ui-rpi:v1.2.2
|
||||
image: christroutner/bch-dex-ui-rpi:v1.2.4
|
||||
container_name: dex-ui
|
||||
logging:
|
||||
driver: 'json-file'
|
||||
|
||||
@@ -88,6 +88,7 @@ class WalletAdapter {
|
||||
}
|
||||
|
||||
const advancedConfig = {}
|
||||
console.log(`Using FullStack.cash: ${this.config.useFullStackCash}`)
|
||||
if (this.config.useFullStackCash) {
|
||||
advancedConfig.interface = 'rest-api'
|
||||
advancedConfig.restURL = this.config.apiServer
|
||||
|
||||
@@ -77,20 +77,12 @@ class OfferUseCases {
|
||||
|
||||
// Verify that UTXO in offer is unspent. If it is spent, then ignore the
|
||||
// offer.
|
||||
// const txid = offerObj.data.utxoTxid
|
||||
// const vout = offerObj.data.utxoVout
|
||||
// const utxoStatus = await this.adapters.bchjs.Blockchain.getTxOut(
|
||||
// txid,
|
||||
// vout
|
||||
// )
|
||||
//
|
||||
const utxo = {
|
||||
tx_hash: offerObj.data.utxoTxid,
|
||||
tx_pos: offerObj.data.utxoVout
|
||||
}
|
||||
// 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
|
||||
@@ -292,18 +284,11 @@ class OfferUseCases {
|
||||
}
|
||||
|
||||
// Verify that UTXO for sale is unspent. Abort if it's been spent.
|
||||
// const txid = offerInfo.utxoTxid
|
||||
// const vout = offerInfo.utxoVout
|
||||
|
||||
const utxo = {
|
||||
tx_hash: offerInfo.utxoTxid,
|
||||
tx_pos: offerInfo.utxoVout
|
||||
}
|
||||
const utxoStatus = await this.adapters.wallet.bchWallet.utxoIsValid(utxo)
|
||||
// const utxoStatus = await this.adapters.bchjs.Blockchain.getTxOut(
|
||||
// txid,
|
||||
// vout
|
||||
// )
|
||||
console.log('utxoStatus: ', utxoStatus)
|
||||
if (!utxoStatus) {
|
||||
console.log(`utxo txid: ${offerInfo.utxoTxid}, vout: ${offerInfo.utxoVout}`)
|
||||
@@ -569,12 +554,6 @@ class OfferUseCases {
|
||||
|
||||
let utxoStatus = null
|
||||
try {
|
||||
// Get the status of the UTXO associate with this Offer.
|
||||
// utxoStatus = await this.adapters.bchjs.Blockchain.getTxOut(
|
||||
// thisOffer.utxoTxid,
|
||||
// thisOffer.utxoVout
|
||||
// )
|
||||
|
||||
// Get the status of the UTXO associate with this Offer.
|
||||
const utxo = {
|
||||
tx_hash: thisOffer.utxoTxid,
|
||||
@@ -582,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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user