cli: Stop topping up buffer balance (#20181)
This commit is contained in:
@ -2037,24 +2037,24 @@ fn complete_partial_program_init(
|
|||||||
if account.owner != *loader_id {
|
if account.owner != *loader_id {
|
||||||
instructions.push(system_instruction::assign(elf_pubkey, loader_id));
|
instructions.push(system_instruction::assign(elf_pubkey, loader_id));
|
||||||
}
|
}
|
||||||
}
|
if account.lamports < minimum_balance {
|
||||||
if account.lamports < minimum_balance {
|
let balance = minimum_balance - account.lamports;
|
||||||
let balance = minimum_balance - account.lamports;
|
instructions.push(system_instruction::transfer(
|
||||||
instructions.push(system_instruction::transfer(
|
payer_pubkey,
|
||||||
payer_pubkey,
|
elf_pubkey,
|
||||||
elf_pubkey,
|
balance,
|
||||||
balance,
|
));
|
||||||
));
|
balance_needed = balance;
|
||||||
balance_needed = balance;
|
} else if account.lamports > minimum_balance
|
||||||
} else if account.lamports > minimum_balance
|
&& system_program::check_id(&account.owner)
|
||||||
&& system_program::check_id(&account.owner)
|
&& !allow_excessive_balance
|
||||||
&& !allow_excessive_balance
|
{
|
||||||
{
|
return Err(format!(
|
||||||
return Err(format!(
|
"Buffer account has a balance: {:?}; it may already be in use",
|
||||||
"Buffer account has a balance: {:?}; it may already be in use",
|
Sol(account.lamports)
|
||||||
Sol(account.lamports)
|
)
|
||||||
)
|
.into());
|
||||||
.into());
|
}
|
||||||
}
|
}
|
||||||
Ok((instructions, balance_needed))
|
Ok((instructions, balance_needed))
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user