Skip to content

Commit 7a22194

Browse files
fix: do not allow decreasing depth in getExtensionCost (#1115)
* fix: do not allow decreasing depth in getExtensionCost * test: update test coverage --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 2788727 commit 7a22194

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/bee.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2196,7 +2196,7 @@ export class Bee {
21962196

21972197
const currentAmount = getAmountForDuration(batch.duration, chainState.currentPrice, blockTime)
21982198
const currentCost = getStampCost(batch.depth, currentAmount)
2199-
const newCost = getStampCost(depth, currentAmount + amount)
2199+
const newCost = getStampCost(Math.max(batch.depth, depth), currentAmount + amount)
22002200

22012201
return newCost.minus(currentCost)
22022202
}

0 commit comments

Comments
 (0)