transaction fee checking for XMR

During transaction creation, check that the fee doesn’t exceed `xmr_max_tx_fee`
This commit is contained in:
The MMGen Project 2026-11-29 17:04:40 +00:00
commit 7a18231ef1
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2
4 changed files with 9 additions and 1 deletions

View file

@ -160,6 +160,9 @@
# Set the maximum transaction fee for RUNE:
# rune_max_tx_fee 5.0
# Set the maximum transaction fee for XMR:
# xmr_max_tx_fee 0.1
# Set the Ethereum mainnet chain names (space-separated list, first is default):
# eth_mainnet_chain_names ethereum foundation

View file

@ -1 +1 @@
17.1.0dev3
17.1.0dev4

View file

@ -38,6 +38,7 @@ class mainnet(CoinProtocol.RPC, CoinProtocol.DummyWIF, CoinProtocol.Base):
privkey_len = 32
mmcaps = ('rpc', 'tw')
coin_amt = 'XMRAmt'
max_tx_fee = 0.1
sign_mode = 'standalone'
has_usr_fee = False
address_reuse_ok = False

View file

@ -180,6 +180,8 @@ class OpSweep(OpMixinSpec, OpWallet):
return tuple(gen())
async def main(self):
from ...tx.util import check_fee
gmsg(
f'\n{self.stem.capitalize()}ing account #{self.account}'
f' of wallet {self.source.idx}{self.add_desc}')
@ -196,6 +198,8 @@ class OpSweep(OpMixinSpec, OpWallet):
h, new_tx = self.create_tx(h, wallet_data)
check_fee(self.proto, new_tx.data.fee)
if not self.compat_call:
msg('\n' + new_tx.get_info(indent=' '))