Skip to content

Commit

Permalink
common: gracefully handle channelDisputeEpochs failure
Browse files Browse the repository at this point in the history
  • Loading branch information
tilacog committed Aug 9, 2023
1 parent 047c539 commit de55495
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,15 @@ export default {
const [currentEpoch, disputeEpochs, maxAllocationEpochs, epochLength] =
await Promise.all([
networkMonitor.networkCurrentEpoch(),
contracts.staking.channelDisputeEpochs(),
contracts.staking.channelDisputeEpochs().catch((error) => {
logger.warn(
'Failed to fetch channel dispute epochs. Ignoring claimable allocations',
{ error, protocolNetwork: network.specification.networkIdentifier },
)
// Remove this call to channelDisputeEpochs once Exponential Rebates are deployed to
// all networks. Using a default value of zero on failure for now.
return 0
}),
contracts.staking.maxAllocationEpochs(),
contracts.epochManager.epochLength(),
])
Expand Down

0 comments on commit de55495

Please sign in to comment.