Skip to content

Commit

Permalink
Prepare SWAP
Browse files Browse the repository at this point in the history
  • Loading branch information
cedelavergne-ledger committed Dec 11, 2024
1 parent 5a6f22f commit 7a2f130
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/swap/handle_sign_transaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ bool swap_check_destination_validity(tx_output_destination_t* destination) {
destination->address.size,
rawAddressHuman,
sizeof(rawAddressHuman));
if (strlen(G_swap_validated.destination) != addrLen) {
PRINTF("Invalid size. %d/%d\n", strlen(G_swap_validated.destination), addrLen);
return false;
}
if (strncmp(G_swap_validated.destination, rawAddressHuman, addrLen) != 0) {
PRINTF("Destination requested in this transaction = %s\n", rawAddressHuman);
PRINTF("Destination validated in swap = %s\n", G_swap_validated.destination);
Expand Down Expand Up @@ -180,7 +184,6 @@ bool swap_check_fee_validity(uint64_t fee) {
void __attribute__((noreturn)) swap_finalize_exchange_sign_transaction(bool is_success) {
PRINTF("is_success: %d\n", is_success);
*G_swap_sign_return_value_address = is_success;
memset(&G_swap_validated, 0, sizeof(G_swap_validated));
os_lib_end();
}

Expand Down

0 comments on commit 7a2f130

Please sign in to comment.