transaction fee checking for XMR
During transaction creation, check that the fee doesn’t exceed `xmr_max_tx_fee`
This commit is contained in:
parent
92d11b011b
commit
7a18231ef1
4 changed files with 9 additions and 1 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
17.1.0dev3
|
||||
17.1.0dev4
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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=' '))
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue