fix(order): Optimizing wallet before creating new orders

This commit is contained in:
Chris Troutner
2022-12-05 09:38:28 -08:00
parent 6b4139a29e
commit b0cc5a6e0b
2 changed files with 4 additions and 0 deletions
+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) {