Skip to content

Commit

Permalink
rhp4: use capacity field
Browse files Browse the repository at this point in the history
  • Loading branch information
n8maninger committed Oct 21, 2024
1 parent bed2bdc commit f0d4bda
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rhp/v4/rhp.go
Original file line number Diff line number Diff line change
Expand Up @@ -594,8 +594,8 @@ func ReviseForRemoveSectors(fc types.V2FileContract, prices HostPrices, newRoot
// ReviseForAppendSectors creates a contract revision from an append sectors request
func ReviseForAppendSectors(fc types.V2FileContract, prices HostPrices, root types.Hash256, appended uint64) (types.V2FileContract, error) {
sectors := fc.Filesize / SectorSize
capacity := fc.Filesize / SectorSize // TODO: use Capacity field
appended -= capacity - sectors // capacity will always be >= sectors
capacity := fc.Capacity / SectorSize
appended -= capacity - sectors // capacity will always be >= sectors
cost, collateral := prices.RPCAppendSectorsCost(appended, fc.ExpirationHeight-prices.TipHeight)
if err := PayWithContract(&fc, cost, collateral); err != nil {
return fc, err
Expand Down

0 comments on commit f0d4bda

Please sign in to comment.