From 881a8821753370dcf0dd2df17c0b07f96d8d9d3b Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Sat, 26 Mar 2022 15:35:26 -0700 Subject: [PATCH] fix(bug): Handling counter offer bug --- src/use-cases/offer/index.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/use-cases/offer/index.js b/src/use-cases/offer/index.js index 29bbe23..f0bfbc9 100644 --- a/src/use-cases/offer/index.js +++ b/src/use-cases/offer/index.js @@ -48,6 +48,13 @@ class OfferUseCases { // console.log('this.adapters.bchjs: ', this.adapters.bchjs) + // Input Validation + // TODO: This is a hack. Find a better way to protect against the corner- + // case of counter-offers getting routed here. + if (offerObj.data.dataType === 'counter-offer') { + console.log('WARN: Counter Offer innappropriately routed to createOffer()') + } + // Verify that UTXO in offer is unspent. If it is spent, then ignore the // offer. const txid = offerObj.data.utxoTxid