Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
CrossChainRecoveryTool.prototype._setCoinInstances = function _setCoinInstances(source, recovery) {
/* eslint-disable no-unused-vars */
const [sourceCoin, sourceModifier] = source.split('-');
const [recoveryCoin, recoveryModifier] = recovery.split('-');
/* eslint-enable no-unused-vars */
// Leaving modifiers alone for now. In the future we can use this to do SegWit recoveries
let network;
if (this.test) {
this.sourceCoin = this.bitgo.coin('t' + sourceCoin);
this.recoveryCoin = this.bitgo.coin('t' + recoveryCoin);
network = bitcoin.networks.testnet;
} else {
this.sourceCoin = this.bitgo.coin(sourceCoin);
this.recoveryCoin = this.bitgo.coin(recoveryCoin);
network = bitcoin.networks.bitcoin;
}
this.recoveryTx = new bitcoin.TransactionBuilder(network);
if (sourceCoin === 'bch') {
this.recoveryTx.enableBitcoinCash(true);
this.recoveryTx.setVersion(2);
}
};