From 7aadef0e38d6eab9ad28d13ee9874e7f2487a42a Mon Sep 17 00:00:00 2001 From: cxp-13 Date: Fri, 20 Sep 2024 21:03:32 +0800 Subject: [PATCH 1/2] fix: Remove the marginfi account check at the end --- .../src/instructions/marginfi_account/flashloan.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/programs/marginfi/src/instructions/marginfi_account/flashloan.rs b/programs/marginfi/src/instructions/marginfi_account/flashloan.rs index b5deb83ce..008e5a035 100644 --- a/programs/marginfi/src/instructions/marginfi_account/flashloan.rs +++ b/programs/marginfi/src/instructions/marginfi_account/flashloan.rs @@ -107,10 +107,10 @@ pub fn check_flashloan_can_start( let marginf_account = marginfi_account.load()?; - check!( - !marginf_account.get_flag(DISABLED_FLAG), - MarginfiError::AccountDisabled - ); + // check!( + // !marginf_account.get_flag(DISABLED_FLAG), + // MarginfiError::AccountDisabled + // ); check!( !marginf_account.get_flag(IN_FLASHLOAN_FLAG), From 616ed145aa59137de488adf8b30d51d6ba5e156b Mon Sep 17 00:00:00 2001 From: cxp-13 Date: Sun, 22 Sep 2024 11:05:57 +0800 Subject: [PATCH 2/2] perf: Remove the marginfi account check at the end --- .../marginfi/src/instructions/marginfi_account/flashloan.rs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/programs/marginfi/src/instructions/marginfi_account/flashloan.rs b/programs/marginfi/src/instructions/marginfi_account/flashloan.rs index 008e5a035..72382cc00 100644 --- a/programs/marginfi/src/instructions/marginfi_account/flashloan.rs +++ b/programs/marginfi/src/instructions/marginfi_account/flashloan.rs @@ -107,11 +107,6 @@ pub fn check_flashloan_can_start( let marginf_account = marginfi_account.load()?; - // check!( - // !marginf_account.get_flag(DISABLED_FLAG), - // MarginfiError::AccountDisabled - // ); - check!( !marginf_account.get_flag(IN_FLASHLOAN_FLAG), MarginfiError::IllegalFlashloan