Merge pull request #66 from Permissionless-Software-Foundation/ct-unstable

Optimize wallet on new orders. Use local P2WDB
This commit is contained in:
Chris Troutner
2022-12-05 09:43:14 -08:00
committed by GitHub
3 changed files with 6 additions and 2 deletions
+2 -2
View File
@@ -50,7 +50,7 @@ services:
container_name: p2wdb
environment:
CONSUMER_URL: 'https://free-bch.fullstack.cash'
#ENABLE_BCH_PAYMENT: 1
ENABLE_BCH_PAYMENT: 1
DEBUG_LEVEL: 1
logging:
driver: 'json-file'
@@ -68,7 +68,7 @@ services:
volumes:
- ../data/ipfsdata/p2wdb:/home/safeuser/ipfs-p2wdb-service/.ipfsdata/p2wdb
- ./p2wdb/start-production.sh:/home/safeuser/ipfs-p2wdb-service/start-production.sh
#- ../scripts/wallet.json:/home/safeuser/ipfs-p2wdb-service/wallet.json
- ../scripts/wallet.json:/home/safeuser/ipfs-p2wdb-service/wallet.json
restart: always
bch-dex:
+3
View File
@@ -49,6 +49,9 @@ class OrderLib {
const orderEntity = this.orderEntity.inputValidate(entryObj)
console.log('orderEntity: ', orderEntity)
// Optimize the wallet to speed up working with it.
await this.retryQueue.addToQueue(this.adapters.wallet.bchWallet.optimize, {})
// Ensure sufficient tokens exist to create the order.
// await this.ensureFunds(orderEntity)
await this.retryQueue.addToQueue(this.ensureFunds, orderEntity)
+1
View File
@@ -37,6 +37,7 @@ class MockBchWallet {
this.getTokenData = async () => {}
this.initialize = async () => {}
this.utxoIsValid = async () => {}
this.optimize = async () => {}
// Environment variable is used by wallet-balance.unit.js to force an error.
if (process.env.NO_UTXO) {