Improve logging on various error conditions

This commit is contained in:
Michael Vines
2018-10-23 10:59:43 -07:00
parent bbb38ac106
commit 4f34822900
3 changed files with 22 additions and 13 deletions

View File

@@ -73,12 +73,15 @@ impl SystemProgram {
program_id,
} => {
if !Self::check_id(&accounts[0].program_id) {
info!("Invalid account[0] program_id");
Err(Error::InvalidArgument)?;
}
if space > 0
&& (!accounts[1].userdata.is_empty()
|| !Self::check_id(&accounts[1].program_id))
{
info!("Invalid account[1]");
Err(Error::InvalidArgument)?;
}
accounts[0].tokens -= tokens;