From 7cc4e80bd6f2c196841a324d01e5fb5284e24e6d Mon Sep 17 00:00:00 2001 From: bishalbikram Date: Fri, 18 Oct 2024 15:18:13 +0545 Subject: [PATCH] fix: close redundant proxy request account --- .../solana/programs/xcall/src/instructions/handle_message.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/contracts/solana/programs/xcall/src/instructions/handle_message.rs b/contracts/solana/programs/xcall/src/instructions/handle_message.rs index 7450194b..ef3e6617 100644 --- a/contracts/solana/programs/xcall/src/instructions/handle_message.rs +++ b/contracts/solana/programs/xcall/src/instructions/handle_message.rs @@ -122,6 +122,11 @@ pub fn handle_request( pending_request.sources.push(source.owner.to_owned()) } if pending_request.sources.len() != req.protocols().len() { + // close the proxy request as it's no longer needed + ctx.accounts + .proxy_request + .close(ctx.accounts.signer.to_account_info())?; + return Ok(()); } pending_request.close(ctx.accounts.admin.clone())?;