From 7a18231ef1ce232acaf1a6357226c10c4d0d23e6 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Sun, 29 Nov 2026 17:04:40 +0000 Subject: [PATCH] transaction fee checking for XMR MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit During transaction creation, check that the fee doesn’t exceed `xmr_max_tx_fee` --- mmgen/data/mmgen.cfg | 3 +++ mmgen/data/version | 2 +- mmgen/proto/xmr/params.py | 1 + mmgen/xmrwallet/ops/sweep.py | 4 ++++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/mmgen/data/mmgen.cfg b/mmgen/data/mmgen.cfg index ab554acc..74538361 100644 --- a/mmgen/data/mmgen.cfg +++ b/mmgen/data/mmgen.cfg @@ -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 diff --git a/mmgen/data/version b/mmgen/data/version index 88d527ef..b068758e 100644 --- a/mmgen/data/version +++ b/mmgen/data/version @@ -1 +1 @@ -17.1.0dev3 +17.1.0dev4 diff --git a/mmgen/proto/xmr/params.py b/mmgen/proto/xmr/params.py index fc7c1014..d9bef55a 100644 --- a/mmgen/proto/xmr/params.py +++ b/mmgen/proto/xmr/params.py @@ -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 diff --git a/mmgen/xmrwallet/ops/sweep.py b/mmgen/xmrwallet/ops/sweep.py index beb6a6bf..eb958349 100644 --- a/mmgen/xmrwallet/ops/sweep.py +++ b/mmgen/xmrwallet/ops/sweep.py @@ -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=' '))