Don't reassign owner in Spawn

This commit is contained in:
Greg Fitzgerald 2019-02-14 12:10:31 -07:00
parent 4a0009365e
commit e1e84d4465
1 changed files with 1 additions and 4 deletions

View File

@ -81,12 +81,9 @@ pub fn entrypoint(
keyed_accounts[to].account.tokens += tokens;
}
SystemInstruction::Spawn => {
if !keyed_accounts[from].account.executable
|| keyed_accounts[from].account.owner != Pubkey::default()
{
if !keyed_accounts[from].account.executable {
Err(ProgramError::AccountNotFinalized)?;
}
keyed_accounts[from].account.owner = *keyed_accounts[from].signer_key().unwrap();
}
}
Ok(())