Merge pull request #4572 from filecoin-project/feat/data-transfer-utils
Flesh out data transfer features
This commit is contained in:
@@ -858,6 +858,14 @@ func (a *API) ClientRestartDataTransfer(ctx context.Context, transferID datatran
|
||||
return a.DataTransfer.RestartDataTransferChannel(ctx, datatransfer.ChannelID{Initiator: otherPeer, Responder: selfPeer, ID: transferID})
|
||||
}
|
||||
|
||||
func (a *API) ClientCancelDataTransfer(ctx context.Context, transferID datatransfer.TransferID, otherPeer peer.ID, isInitiator bool) error {
|
||||
selfPeer := a.Host.ID()
|
||||
if isInitiator {
|
||||
return a.DataTransfer.CloseDataTransferChannel(ctx, datatransfer.ChannelID{Initiator: selfPeer, Responder: otherPeer, ID: transferID})
|
||||
}
|
||||
return a.DataTransfer.CloseDataTransferChannel(ctx, datatransfer.ChannelID{Initiator: otherPeer, Responder: selfPeer, ID: transferID})
|
||||
}
|
||||
|
||||
func newDealInfo(v storagemarket.ClientDeal) api.DealInfo {
|
||||
return api.DealInfo{
|
||||
ProposalCid: v.ProposalCid,
|
||||
|
||||
Reference in New Issue
Block a user