livepeer / protocol

Livepeer protocol
MIT License
152 stars 45 forks source link

bonding: Remove require in pendingStake() and pendingFees() #365

Closed yondonfu closed 4 years ago

yondonfu commented 4 years ago

This PR removes the require statements in BondingManager.pendingStake() and BondingManager.pendingFees(). Instead of validating the _endRound argument using a require statement, both functions will now execute pending stake/fee calculations through the current round if _endRound > currentRound. If the _endRound <= delegator.lastClaimRound, the loop that executes the calculations will not run and pendingStake() will return delegator.bondedAmount and pendingFees() will return delegator.fees.

Fixes #363