Skip to content
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

eth/coiner: Save value of one initiation. #1476

Merged
merged 1 commit into from
Feb 18, 2022

Conversation

JoeGruffins
Copy link
Member

Save and return the value of a specific initiation rather than the
entire transaction value for validation later. This allows coins that
share a transaction to be matched separately.

closes #1469

Comment on lines 296 to 300
// If an initiation, return the value of one swap in order to validate
// during processing.
if c.initValue != nil {
return *c.initValue
}
Copy link
Member

@chappjc chappjc Feb 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like we just neglected to override the base method with a swapCoin method:

func (c *swapCoin) Value() uint64 {
	return c.init.Value
}

BTW, good catch!

Copy link
Member Author

@JoeGruffins JoeGruffins Feb 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh... does that work? I was thinking we couldn't override methods in go, I'm such a noob.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Also added a small log change.
Before:

2022-02-18 11:17:18.366 [INF] CORE: Broadcasted redeem transaction spending 1 contracts for order 5b031052bb914849759ff1ce92b8fd9e75ec0c0e5661a27ae1f261f9ca340c88, paying to {307831633846393038643939463632353232463845304144393530344646634331383765353531346361:1c8f908d99f62522f8e0ad9504ffcc187e5514ca000000003ce5c090} (eth)

After

2022-02-18 13:18:33.608 [INF] CORE: Broadcasted redeem transaction spending 1 contracts for order 161e7f247c527d0ecf69a44a5813ea4fd72254bdd9c10c04529f9f439d2585eb, paying to {0x1c8F908d99F62522F8E0AD9504FFcC187e5514ca:1c8f908d99f62522f8e0ad9504ffcc187e5514ca0000000054285790} (eth)

Save and return the value of a specific initiation rather than the
entire transaction value for validation later. This allows coins that
share a transaction to be matched separately.
@chappjc chappjc merged commit 0c75bd4 into decred:master Feb 18, 2022
@chappjc chappjc added this to the 0.5 milestone Apr 21, 2022
@chappjc chappjc added the ETH label Aug 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dcr-eth: Unable to match multiple sell orders.
2 participants