-
Notifications
You must be signed in to change notification settings - Fork 97
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
dcr: Add mix split tx identification. #3061
Conversation
It is a good fix already .. but .. "This dumbly checks for at least three outputs of the same size and three of other sizes." How could it be less naive? |
dcrdata does this https://github.com/decred/dcrdata/blob/e9c73122122a65fbb2019eb31a526a854e927edc/txhelpers/cspp.go#L84 So we could do that. However as I said in the comment we can't be sure of the transaction fee unless it is default, which it probably is, or if we also look at the ticket transaction, which may not be available yet and takes more code to find. We could just use the base ticket price which is in the header for that block, and also look for values that are just a little bit more. However we aren't using the header yet in afaik having three outputs that are the same, and then three more, would never happen naturally with what the current bisonw does. Even if we wanted to make three split outputs, then we would only have one change output. |
867451f
to
909e4b5
Compare
client/asset/dcr/dcr.go
Outdated
if owns { | ||
mixedAmount += uint64(txOut.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.
Wouldn't this also count the value of a change output? How about changing the isMixedSplitTx
signature to also return the ticketOutAmt
as it does in dcrdata. Then you could reuse the same block above where it checks if txOut.Value == mixDenom {
.
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.
Ok, I wasn't sure what we wanted to show. If just ticket amounts can do that.
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.
Only adding tickets for mixed amount https://github.com/decred/dcrdex/compare/909e4b5a918c4b1ad7797f7fd5cce6128ea4b6a6..74578b75da4ced4016b297655266295a75bdb374
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.
Looks like the inputs of these transactions are all the size of a mix output or a ticket redemption right? And the outputs are either the size of a ticket purchase or a change, is this correct? If so, then I think it makes sense to display the ticket amounts.
909e4b5
to
74578b7
Compare
You could do this to avoid the duplication: 29ee36d |
Ok added those changes! |
* dcr: Add mix split tx identification. * Combine regular mix and split ticket mix logic --------- Co-authored-by: martonp <marci93@gmail.com>
closes #3057