From b93957d9785c1db577f131f72da6c37e69cb3d3a Mon Sep 17 00:00:00 2001 From: Joe Date: Fri, 29 Sep 2023 21:07:43 +0200 Subject: [PATCH] move lamport calculation --- runtime/src/bank.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index 2fe44d134a98c8..e00213824c920f 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -8314,13 +8314,11 @@ impl Bank { .get_account_with_fixed_root(destination_address) .is_none() { - let lamports = self.get_minimum_balance_for_rent_exemption( - UpgradeableLoaderState::size_of_program(), - ); let state = UpgradeableLoaderState::Program { programdata_address: destination_data_address, }; if let Ok(data) = bincode::serialize(&state) { + let lamports = self.get_minimum_balance_for_rent_exemption(data.len()); let created_program_account = Account { lamports, data,