Open neocarmack opened 2 years ago
This issue is the tenth bug in issue 53: https://github.com/omnilaboratory/obd/issues/53
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 }
This issue is the tenth bug in issue 53: https://github.com/omnilaboratory/obd/issues/53
channelInfo's fields are different from the obd.
when obd commits channelInfo to a tracker, now we have the code to convert:
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: