Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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);
}
};