privatesend: Make sure change in MakeCollateralAmounts has min value#3639
Closed
xdustinface wants to merge 1 commit intodashpay:developfrom
Closed
privatesend: Make sure change in MakeCollateralAmounts has min value#3639xdustinface wants to merge 1 commit intodashpay:developfrom
xdustinface wants to merge 1 commit intodashpay:developfrom
Conversation
|
Interesting find 👍 but I think the root cause is incorrect |
Author
Better find 👍 I had the fee under suspicion but seems like i lost track anywhere down the road haha |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is a fix for #3597. The issue there is that we run in cases where the change output in
CPrivateSendClientSession::MakeCollateralAmountsis too small to be considered as private send collateral. This leads to those change outputs returningfalseforCPrivateSend::IsCollateralAmountindash/src/qt/transactionrecord.cpp
Lines 159 to 160 in 0fbfd9b
As fix
CPrivateSendClientSession::MakeCollateralAmountssimply skips “PrivateSend Make Collateral Inputs” transactions with change outputs smaller thanGetCollateralAmount(). This way we also don’t leave tiny outputs in the wallet but instead a bit bigger ones if they don’t contain enough.. i guess that makes sense?a195832 is alternative GUI only fix which also allows change outputs smaller than
GetCollateralAmount()by setting the minimum required value toGetMaxCollateralAmount()inTransactionRecord::decomposeTransactiondash/src/qt/transactionrecord.cpp
Lines 159 to 160 in a195832
I tested a195832 and it works but i couldn’t verify 0fbfd9b since its not so easy to reproduce the issue. But just from looking at the code, it should make sense and we should go with 0fbfd9b, no?