Skip to content

Commit a10a1c5

Browse files
committed
Reset state when doing return of final value
1 parent 383f998 commit a10a1c5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,10 @@ pub fn poll_apdu_handler<'a: 'b, 'b, StateHolderT: 'static + StateHolderCtr, A:
436436
}
437437
// Then, check that if we're waiting that we've actually given the host something to do.
438438
if io.0.borrow().sent_command.is_some() {
439+
if io.0.borrow().sent_command == Some(LedgerToHostCmd::ResultFinal) {
440+
// This is the end of the current APDU, so reset state
441+
s.set(core::default::Default::default());
442+
}
439443
return Ok(())
440444
} else if trampoline_res == AsyncTrampolineResult::Resolved {
441445
} else {

0 commit comments

Comments
 (0)