Wrap tx creation in a try catch

This commit is contained in:
Marcos Rodriguez Vélez 2018-10-26 21:21:08 -04:00
parent 2f20186719
commit 57da0926d1

View file

@ -205,7 +205,14 @@ export default class SendDetails extends Component {
}
let startTime = Date.now();
tx = this.state.fromWallet.createTx(utxo, this.state.amount, fee, this.state.address, this.state.memo);
try {
tx = this.state.fromWallet.createTx(utxo, this.state.amount, fee, this.state.address, this.state.memo);
} catch (error) {
console.log(error);
alert(loc.send.details.create_tx_error);
this.setState({ isLoading: false });
return;
}
let endTime = Date.now();
console.log('create tx ', (endTime - startTime) / 1000, 'sec');