txcreate, txsign: enforce cfg.autosign if cfg.coin == 'XMR'

This commit is contained in:
The MMGen Project 2026-08-29 15:04:29 +00:00
commit b5c4b134c9
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2
2 changed files with 3 additions and 0 deletions

View file

@ -33,6 +33,7 @@ opts_data = {
'swaptx': ['-', 's'],
}[target],
'sets': [('yes', True, 'quiet', True)],
'requires': [('coin', 'XMR', 'autosign', True)],
'text': {
'desc': {
'tx': f'Create a transaction with outputs to specified coin or {gc.proj_name} addresses',

View file

@ -155,6 +155,8 @@ async def process_tx(tx):
cfg._util.vmsg(f'Getting {tx.desc}{tx.infile}')
if tx.is_compat:
if not cfg.autosign:
die(1, 'Sending XMR transaction via compatibility layer requires --autosign')
return await tx.compat_send()
txcfg = Config({'_clone': cfg, 'proto': tx.proto, 'coin': tx.proto.coin})