Don't reassign owner in Spawn
This commit is contained in:
@ -81,12 +81,9 @@ pub fn entrypoint(
|
|||||||
keyed_accounts[to].account.tokens += tokens;
|
keyed_accounts[to].account.tokens += tokens;
|
||||||
}
|
}
|
||||||
SystemInstruction::Spawn => {
|
SystemInstruction::Spawn => {
|
||||||
if !keyed_accounts[from].account.executable
|
if !keyed_accounts[from].account.executable {
|
||||||
|| keyed_accounts[from].account.owner != Pubkey::default()
|
|
||||||
{
|
|
||||||
Err(ProgramError::AccountNotFinalized)?;
|
Err(ProgramError::AccountNotFinalized)?;
|
||||||
}
|
}
|
||||||
keyed_accounts[from].account.owner = *keyed_accounts[from].signer_key().unwrap();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
|
Reference in New Issue
Block a user