Skip to content

Commit

Permalink
rhp: pessimistic readsector cost
Browse files Browse the repository at this point in the history
  • Loading branch information
peterjan committed Aug 21, 2024
1 parent f4c4dbd commit ecfb8a9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions internal/rhp/v3/rhp.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ func (c *Client) ReadSector(ctx context.Context, offset, length uint32, root typ
return err
}

amount = cost // pessimistic cost estimate in case rpc fails
payment := rhpv3.PayByEphemeralAccount(accID, cost, pt.HostBlockHeight+defaultWithdrawalExpiryBlocks, accKey)
cost, refund, err := rpcReadSector(ctx, t, w, pt, &payment, offset, length, root)
if err != nil {
Expand Down

0 comments on commit ecfb8a9

Please sign in to comment.