feat(markets): use new api

This commit is contained in:
hannahhoward 2020-09-07 05:33:35 -07:00 committed by Aayush Rajasekaran
parent 2db4b57013
commit 5ad8e23eae

View File

@ -79,14 +79,8 @@ func (rcn *retrievalClientNode) WaitForPaymentChannelReady(ctx context.Context,
} }
func (rcn *retrievalClientNode) CheckAvailableFunds(ctx context.Context, paymentChannel address.Address) (retrievalmarket.ChannelAvailableFunds, error) { func (rcn *retrievalClientNode) CheckAvailableFunds(ctx context.Context, paymentChannel address.Address) (retrievalmarket.ChannelAvailableFunds, error) {
// this doesn't actually work potentially -- the looked up from/to may pull up data for a different payment channel if for some reason the
// given address is settling channelAvailableFunds, err := rcn.payAPI.PaychAvailableFunds(paymentChannel)
ci, err := rcn.payAPI.PaychMgr.GetChannelInfo(paymentChannel)
if err != nil {
return retrievalmarket.ChannelAvailableFunds{}, err
}
// assuming this is outbound... again, this is not a final implementation, pending PaychAvailableFundsByAddress
channelAvailableFunds, err := rcn.payAPI.PaychAvailableFunds(ci.Control, ci.Target)
if err != nil { if err != nil {
return retrievalmarket.ChannelAvailableFunds{}, err return retrievalmarket.ChannelAvailableFunds{}, err
} }