From f86bf7baa91eaa8d0eb636665fab9a43411a90d1 Mon Sep 17 00:00:00 2001 From: wwestgarth Date: Fri, 16 Aug 2024 15:59:36 +0100 Subject: [PATCH] fix: actually set err so that the defer to cleanup after amend runs --- core/execution/future/market.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/execution/future/market.go b/core/execution/future/market.go index cac47e4273..0748ce1791 100644 --- a/core/execution/future/market.go +++ b/core/execution/future/market.go @@ -5589,7 +5589,8 @@ func (m *Market) AmendAMM(ctx context.Context, amend *types.AmendAMM, determinis m.log.Panic("unable to restore AMM balances after failed amend", logging.Error(err)) } } - return common.ErrAMMCannotRebase + err = common.ErrAMMCannotRebase // set it to err so that the defer runs + return err } m.amm.Confirm(ctx, pool)