mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-01-19 05:45:15 +01:00
FIX: Wont broadcast tx with too small fee
This commit is contained in:
parent
d07082f4dd
commit
46fb9617e0
@ -82,7 +82,10 @@ export default class SendCreate extends Component {
|
||||
let feeSatoshi = new BigNumber(this.state.fee);
|
||||
feeSatoshi = feeSatoshi.mul(100000000);
|
||||
satoshiPerByte = feeSatoshi.div(Math.round(tx.length / 2));
|
||||
satoshiPerByte = Math.round(satoshiPerByte.toString(10));
|
||||
satoshiPerByte = Math.floor(satoshiPerByte.toString(10));
|
||||
if (satoshiPerByte < 1) {
|
||||
throw new Error('Not enough fee. Increase the fee');
|
||||
}
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
return this.setState({
|
||||
|
@ -117,7 +117,7 @@ export default class SendDetails extends Component {
|
||||
} catch (err) {
|
||||
return balance;
|
||||
}
|
||||
console.log(typeof availableBalance, availableBalance);
|
||||
|
||||
return (availableBalance === 'NaN' && balance) || availableBalance;
|
||||
}
|
||||
|
||||
@ -146,6 +146,14 @@ export default class SendDetails extends Component {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.recalculateAvailableBalance(this.state.fromWallet.getBalance(), this.state.amount, this.state.fee) < 0) {
|
||||
this.setState({
|
||||
errorMessage: loc.send.details.amount_fiels_is_not_valid,
|
||||
});
|
||||
console.log('validation error');
|
||||
return;
|
||||
}
|
||||
|
||||
this.setState({
|
||||
errorMessage: '',
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user