FIX: Fix transaction fee for BIP70 payments

This commit is contained in:
Marcos Rodriguez Vélez 2019-02-23 14:04:37 -05:00 committed by Igor Korsakov
parent 6dd83afd09
commit 445d85e6c4
2 changed files with 11 additions and 4 deletions

5
package-lock.json generated
View file

@ -11590,9 +11590,8 @@
}
},
"react-native-tooltip": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/react-native-tooltip/-/react-native-tooltip-5.2.0.tgz",
"integrity": "sha512-3mbPGd/VDfb3dUZmdmgg4eE8idJU4OyYM9ItGifnofz+Cz50Aua+sVGo2Ecc7zHV0S+kM0mOyLL758hhTz2gDw=="
"version": "git+https://github.com/BlueWallet/react-native-tooltip.git#72329a1a687ce9938eca11f0026f1a58c326db33",
"from": "git+https://github.com/BlueWallet/react-native-tooltip.git"
},
"react-native-vector-icons": {
"version": "6.2.0",

View file

@ -283,11 +283,19 @@ export default class SendDetails extends Component {
Keyboard.dismiss();
BitcoinBIP70TransactionDecode.decode(text)
.then(response => {
let networkTransactionFees = this.state.networkTransactionFees;
if (response.fee > networkTransactionFees.fastestFee) {
networkTransactionFees.fastestFee = response.fee;
} else {
networkTransactionFees.halfHourFee = response.fee;
}
this.setState({
address: response.address,
amount: loc.formatBalanceWithoutSuffix(response.amount, BitcoinUnit.BTC, false),
memo: response.memo,
fee: response.fee,
networkTransactionFees,
fee: networkTransactionFees.fastestFee.toFixed(0),
feeSliderValue: networkTransactionFees.fastestFee.toFixed(0),
bip70TransactionExpiration: response.expires,
isLoading: false,
});