@atomiqlabs/lp-lib 13.0.0 → 13.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -376,7 +376,9 @@ class SpvVaultSwapHandler extends SwapHandler_1.SwapHandler {
|
|
|
376
376
|
data.btcTx.outs[0].value !== SpvVaults_1.VAULT_DUST_AMOUNT ||
|
|
377
377
|
!Buffer.from(data.btcTx.outs[0].scriptPubKey.hex, "hex").equals(this.bitcoin.toOutputScript(swap.vaultAddress)) ||
|
|
378
378
|
BigInt(data.btcTx.outs[2].value) !== swap.amountBtc ||
|
|
379
|
-
!Buffer.from(data.btcTx.outs[2].scriptPubKey.hex, "hex").equals(this.bitcoin.toOutputScript(swap.btcAddress))
|
|
379
|
+
!Buffer.from(data.btcTx.outs[2].scriptPubKey.hex, "hex").equals(this.bitcoin.toOutputScript(swap.btcAddress)) ||
|
|
380
|
+
(data.btcTx.locktime > 0 && data.btcTx.locktime < 500000000) ||
|
|
381
|
+
data.btcTx.locktime > Math.floor(Date.now() / 1000) - 1000000) {
|
|
380
382
|
this.swapLogger.error(swap, "REST: /postQuote: Invalid psbt data submitted, raw psbt hex: ", parsedBody.psbtHex);
|
|
381
383
|
throw {
|
|
382
384
|
code: 20509,
|
package/package.json
CHANGED
|
@@ -506,7 +506,9 @@ export class SpvVaultSwapHandler extends SwapHandler<SpvVaultSwap, SpvVaultSwapS
|
|
|
506
506
|
data.btcTx.outs[0].value!==VAULT_DUST_AMOUNT ||
|
|
507
507
|
!Buffer.from(data.btcTx.outs[0].scriptPubKey.hex, "hex").equals(this.bitcoin.toOutputScript(swap.vaultAddress)) ||
|
|
508
508
|
BigInt(data.btcTx.outs[2].value)!==swap.amountBtc ||
|
|
509
|
-
!Buffer.from(data.btcTx.outs[2].scriptPubKey.hex, "hex").equals(this.bitcoin.toOutputScript(swap.btcAddress))
|
|
509
|
+
!Buffer.from(data.btcTx.outs[2].scriptPubKey.hex, "hex").equals(this.bitcoin.toOutputScript(swap.btcAddress)) ||
|
|
510
|
+
(data.btcTx.locktime > 0 && data.btcTx.locktime < 500_000_000) ||
|
|
511
|
+
data.btcTx.locktime > Math.floor(Date.now()/1000) - 1_000_000
|
|
510
512
|
) {
|
|
511
513
|
this.swapLogger.error(swap, "REST: /postQuote: Invalid psbt data submitted, raw psbt hex: ", parsedBody.psbtHex);
|
|
512
514
|
throw {
|