Skip to content

Commit 7c8a971

Browse files
abelmarnkfebo
andauthored
Aid compiler.
Co-authored-by: Fernando Otero <febo@anza.xyz>
1 parent 3cb35b8 commit 7c8a971

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

program/src/processor.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1696,9 +1696,10 @@ impl Processor {
16961696
}
16971697

16981698
if amount == 0 {
1699-
check_program_account(source_account_info.owner)?;
1699+
check_program_account(source_account_info.owner)
17001700
} else {
1701-
if !self_transfer {
1701+
source_account.base.amount = remaining_amount.into();
1702+
if source_account_info.key != destination_account_info.key {
17021703
let source_starting_lamports = source_account_info.lamports();
17031704
**source_account_info.lamports.borrow_mut() = source_starting_lamports
17041705
.checked_sub(amount)
@@ -1709,10 +1710,8 @@ impl Processor {
17091710
.checked_add(amount)
17101711
.ok_or(TokenError::Overflow)?;
17111712
}
1712-
source_account.base.amount = remaining_amount.into();
1713+
Ok(())
17131714
}
1714-
1715-
Ok(())
17161715
}
17171716

17181717
/// Processes an [`Instruction`](enum.Instruction.html).

0 commit comments

Comments
 (0)