Browse Source

trustedcoin: stricter client-side checks for 2fa fee

master
SomberNight 3 years ago
parent
commit
87cba8bf32
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
  1. 6
      electrum/plugins/trustedcoin/trustedcoin.py

6
electrum/plugins/trustedcoin/trustedcoin.py

@ -314,8 +314,10 @@ class Wallet_2fa(Multisig_Wallet):
return 0 return 0
n = self.num_prepay() n = self.num_prepay()
price = int(self.price_per_tx[n]) price = int(self.price_per_tx[n])
if price > 100000 * n: # sanity check: price capped at 0.5 mBTC per tx or 20 mBTC total
raise Exception('too high trustedcoin fee ({} for {} txns)'.format(price, n)) # (note that the server can influence our choice of n by sending unexpected values)
if price > min(50_000 * n, 2_000_000):
raise Exception(f"too high trustedcoin fee ({price} for {n} txns)")
return price return price
def make_unsigned_transaction( def make_unsigned_transaction(

Loading…
Cancel
Save