-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Manual payout tool: prevent absurdly high fee payout #5099
Conversation
- trims whitespace from numeric input fields before parsing - adds percentage display of the tx fee - validates that the tx fee percentage is not higher than 10%
@@ -544,6 +553,8 @@ private void calculateTxFee() { | |||
.subtract(getInputFieldAsCoin(buyerPayoutAmount)) | |||
.subtract(getInputFieldAsCoin(sellerPayoutAmount)); | |||
txFee.setText(txFeeValue.toPlainString()); | |||
double feePercent = (double) txFeeValue.value / getInputFieldAsCoin(amountInMultisig).value; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe safer to wrap it into a try catch? E.g. if getInputFieldAsCoin(amountInMultisig).value can be 0 it would throw an exception.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK
I just cherry-picked it into the release branch |
This PR adds display of the Tx fee as a percentage, and includes validation to disallow the payout processing if tx fee is > 10% of the multisig amount. The Tx cannot be signed or built until validation passes.
Fixes a bug whereby whitespace in an amount caused it to be parsed as 0. It now trims whitespace from numeric input fields before parsing.
Screenshot showing the new Tx fee % field: