[FIX] remove unused code

Remove code  that not used.
Also remove global veriable, introduced by this code
Also there was error when using custom currency (one not in 'currencies_all_keyed' map)