fix(acceptCounterOffer()): Appropriately ignoring Counter Offers

This commit is contained in:
Chris Troutner
2022-03-26 19:35:15 -07:00
parent fa834e9114
commit f2b8ccaa3a
2 changed files with 9 additions and 3 deletions
+8 -2
View File
@@ -274,8 +274,14 @@ class OfferUseCases {
// See if this instance of bch-dex is managing the Order associated with
// the incoming Counter Offer.
const orderHash = p2wdbData.data.offerHash
const orderData = await this.orderUseCase.findOrderByHash(orderHash)
console.log(`orderData: ${JSON.stringify(orderData, null, 2)}`)
let orderData = {}
try {
orderData = await this.orderUseCase.findOrderByHash(orderHash)
console.log(`orderData: ${JSON.stringify(orderData, null, 2)}`)
} catch (err) {
console.log('Order matching this Counter Offer is not managed by this instance of bch-dex. Exiting.')
return 'N/A'
}
// Deserialize the partially signed transaction.
const txHex = p2wdbData.data.partialTxHex
+1 -1
View File
@@ -160,7 +160,7 @@ class OrderLib {
return orderObject
} catch (err) {
console.error('Error in findOrder(): ', err)
console.error('Error in findOrder()')
throw err
}
}