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

channelInfo's fields on tracker are different to the obd. #56

Open
neocarmack opened this issue Mar 4, 2022 · 0 comments · May be fixed by #54
Open

channelInfo's fields on tracker are different to the obd. #56

neocarmack opened this issue Mar 4, 2022 · 0 comments · May be fixed by #54
Assignees
Labels
bug Something isn't working

Comments

@neocarmack
Copy link
Member

neocarmack commented Mar 4, 2022

This issue is the tenth bug in issue 53: #53

  1. channelInfo's fields are different from the obd.
    when obd commits channelInfo to a tracker, now we have the code to convert:
    //infoRequest is the data submit to tracker
	infoRequest.PeerIdA = channelInfo.PeerIdA
	infoRequest.PeerIdB = channelInfo.PeerIdB

	infoRequest.IsAlice = false
	if commitmentTx.Id > 0 {
		if commitmentTx.Owner == channelInfo.PeerIdA {
			infoRequest.IsAlice = true
			infoRequest.AmountA = commitmentTx.AmountToRSMC
			infoRequest.AmountB = commitmentTx.AmountToCounterparty
		} else {
			infoRequest.AmountB = commitmentTx.AmountToRSMC
			infoRequest.AmountA = commitmentTx.AmountToCounterparty
		}
	}

We should modify channelInfo's fields to be the same as the tracker. It will be easy when updates the sync mode between the obd and tracker.

channelInfo.IsAlice should be a function, it's a computed field. For example:

func (c *channelInfo)IsAlice(currentUserPeerID) bool{
	return c.PeerIdA==currentUserPeerID
}
@neocarmack neocarmack added the bug Something isn't working label Mar 4, 2022
@neocarmack neocarmack linked a pull request Mar 4, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants