@atomiqlabs/lp-lib 15.0.5 → 15.0.7

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.
@@ -250,13 +250,9 @@ class SpvVaults {
250
250
  const btcTx = await (0, BitcoinUtils_1.checkTransactionReplacedRpc)(pendingWithdrawal.btcTx.txid, pendingWithdrawal.btcTx.raw, this.bitcoinRpc);
251
251
  if (btcTx == null) {
252
252
  //Probable double-spend, remove from pending withdrawals
253
- const index = vault.pendingWithdrawals.indexOf(pendingWithdrawal);
254
- if (index === -1) {
253
+ if (!vault.removeWithdrawal(pendingWithdrawal)) {
255
254
  this.logger.warn("checkVaults(): Tried to remove pending withdrawal txId: " + pendingWithdrawal.btcTx.txid + ", but doesn't exist anymore!");
256
255
  }
257
- else {
258
- vault.pendingWithdrawals.splice(index, 1);
259
- }
260
256
  changed = true;
261
257
  }
262
258
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atomiqlabs/lp-lib",
3
- "version": "15.0.5",
3
+ "version": "15.0.7",
4
4
  "description": "Main functionality implementation for atomiq LP node",
5
5
  "main": "./dist/index.js",
6
6
  "types:": "./dist/index.d.ts",
@@ -23,7 +23,7 @@
23
23
  "license": "ISC",
24
24
  "dependencies": {
25
25
  "@atomiqlabs/base": "^11.0.0",
26
- "@atomiqlabs/server-base": "2.0.0",
26
+ "@atomiqlabs/server-base": "^3.0.0",
27
27
  "@scure/btc-signer": "1.6.0",
28
28
  "express": "4.21.1",
29
29
  "promise-queue-ts": "0.0.1"
@@ -309,11 +309,8 @@ export class SpvVaults {
309
309
  const btcTx = await checkTransactionReplacedRpc(pendingWithdrawal.btcTx.txid, pendingWithdrawal.btcTx.raw, this.bitcoinRpc);
310
310
  if(btcTx==null) {
311
311
  //Probable double-spend, remove from pending withdrawals
312
- const index = vault.pendingWithdrawals.indexOf(pendingWithdrawal);
313
- if(index===-1) {
312
+ if(!vault.removeWithdrawal(pendingWithdrawal)) {
314
313
  this.logger.warn("checkVaults(): Tried to remove pending withdrawal txId: "+pendingWithdrawal.btcTx.txid+", but doesn't exist anymore!")
315
- } else {
316
- vault.pendingWithdrawals.splice(index, 1);
317
314
  }
318
315
  changed = true;
319
316
  } else {