get10101 / 10101

10101 (Ten-Ten-One): Self-custodial derivative trading at your fingertips.
https://10101.finance
MIT License
124 stars 21 forks source link

fix: Only accept a rollover offer if the contract has been confirmed. #2633

Open holzeis opened 2 weeks ago

holzeis commented 2 weeks ago

Syncs the wallet eagerly if the channel is not yet confirmed.

If the contract is not confirmed, the rollover offer gets rejected. This fixes an issue where the app otherwise risk ending up in an intermediate state as it can't accept the RenewConfirm message.

fixes https://github.com/get10101/10101/issues/2630

holzeis commented 2 weeks ago

@luckysori Any idea why 9635806fc4c065520d50588befbf30a4577fef53 doesn't fix the issue?

Even though I pass the check if confirmed contract check when processing the RolloverOffer processing the RolloverConfirm message still fails on an invalid state error.

Failed to handle RolloverConfirm message from 02dd6abec97f9a748bf76ad502b004ce05d1b2d1f43a9e76bd7d85e767ffb022c9: Invalid state: Invalid state Contract { state: "signed" } expected Confirmed.