edge-currency-plugins 2.5.2 → 2.5.4

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.
@@ -144,8 +144,9 @@ var _utils3 = require('./utils');
144
144
  const { canReplaceByFee = false } = currencyInfo
145
145
  if (!canReplaceByFee) return null
146
146
 
147
- // Accelerate for legacy Airbitz wallets is not supported
148
- if (privateKeyFormat === 'bip32') return null
147
+ // Accelerate for non-segwit wallets is not supported
148
+ if (privateKeyFormat === 'bip32' || privateKeyFormat === 'bip44')
149
+ return null
149
150
 
150
151
  // Get the replaced transaction from the processor:
151
152
  const replacedTxid = edgeTx.txid
@@ -13,5 +13,10 @@ var _utils = require('./utils'); var utils = _interopRequireWildcard(_utils);
13
13
  const fee = Math.ceil(feeRate * utils.transactionBytes(utxos, outputs))
14
14
  targets[0].value -= fee
15
15
  outputs[0].value -= fee
16
+
17
+ const targetValue = utils.sumOrNaN(targets)
18
+ if (isNaN(targetValue) || fee > targetValue)
19
+ return { inputs: utxos, fee, changeUsed: false }
20
+
16
21
  return { inputs: utxos, outputs, fee, changeUsed: false }
17
22
  } exports.subtractFee = subtractFee;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "edge-currency-plugins",
3
- "version": "2.5.2",
3
+ "version": "2.5.4",
4
4
  "description": "Edge currency plugins to fetch and process wallet accounts, balances and transactions.",
5
5
  "repository": "https://github.com/EdgeApp/edge-currency-plugins",
6
6
  "license": "MIT",