1
0

trustedcoin: stricter client-side checks for 2fa fee

This commit is contained in:
SomberNight
2023-06-13 16:52:50 +00:00
parent 23f2412da7
commit 87cba8bf32

View File

@@ -314,8 +314,10 @@ class Wallet_2fa(Multisig_Wallet):
return 0
n = self.num_prepay()
price = int(self.price_per_tx[n])
if price > 100000 * n:
raise Exception('too high trustedcoin fee ({} for {} txns)'.format(price, n))
# sanity check: price capped at 0.5 mBTC per tx or 20 mBTC total
# (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
def make_unsigned_transaction(