Browse Source

Allow sending dexfee to old address for a while.

blackjok3r
Artem Pikulin 6 years ago
parent
commit
dd8b6f9342
  1. 6
      iguana/exchanges/LP_etomic.c
  2. 5
      iguana/exchanges/LP_include.h

6
iguana/exchanges/LP_etomic.c

@ -59,7 +59,7 @@ uint8_t LP_etomic_verify_alice_fee(struct basilisk_swap *swap)
}
if ( strcmp(swap->I.alicestr,"ETH") == 0 ) {
if (compareAddresses(data.to, INSTANTDEX_ETHADDR) == 0) {
if (compareAddresses(data.to, INSTANTDEX_ETHADDR) == 0 && compareAddresses(data.to, INSTANTDEX_OLD_ETHADDR) == 0) {
printf("Alice fee %s was sent to wrong address %s\n", swap->otherfee.I.ethTxid, data.to);
return(0);
}
@ -78,7 +78,9 @@ uint8_t LP_etomic_verify_alice_fee(struct basilisk_swap *swap)
}
char weiAmount[70];
satoshisToWei(weiAmount, LP_DEXFEE(swap->I.alicerealsat));
return(verifyAliceErc20FeeData(swap->I.alicetomic, INSTANTDEX_ETHADDR, weiAmount, data.input, alicecoin->decimals));
uint8_t verify_new = verifyAliceErc20FeeData(swap->I.alicetomic, INSTANTDEX_ETHADDR, weiAmount, data.input, alicecoin->decimals);
uint8_t verify_old = verifyAliceErc20FeeData(swap->I.alicetomic, INSTANTDEX_OLD_ETHADDR, weiAmount, data.input, alicecoin->decimals);
return((uint8_t)(verify_new || verify_old));
}
}

5
iguana/exchanges/LP_include.h

@ -113,6 +113,11 @@ void emscripten_usleep(int32_t x); // returns immediate, no sense for sleeping
#define INSTANTDEX_INSURANCEDIV 777
#define INSTANTDEX_PUBKEY "03bc2c7ba671bae4a6fc835244c9762b41647b9827d4780a89a949b984a8ddcc06"
#define INSTANTDEX_ETHADDR "0xd8997941dd1346e9231118d5685d866294f59e5b"
// Artem Pikulin:
// This is invalid address got from zero pubkey because of error in pubKey2Addr(char* pubKey)
// Going to keep it for a while because some nodes might be not updated and still send fee to old address.
// I think it's better to allow swap to continue even if fee sent to wrong address.
#define INSTANTDEX_OLD_ETHADDR "0x3f17f1962B36e491b30A40b2405849e597Ba5FB5"
#define INSTANTDEX_RMD160 "ca1e04745e8ca0c60d8c5881531d51bec470743f"
#define JUMBLR_RMD160 "5177f8b427e5f47342a4b8ab5dac770815d4389e"
#define TIERNOLAN_RMD160 "daedddd8dbe7a2439841ced40ba9c3d375f98146"

Loading…
Cancel
Save