Cap SAL1 unsweep fanout
This commit is contained in:
@@ -34,6 +34,7 @@ A PHP-based Telegram tip bot for the Salvium (Monero fork) cryptocurrency.
|
||||
- `WITHDRAWAL_FEE` is charged in `SAL1` for `SAL1` withdrawals.
|
||||
- `TOKEN_WITHDRAWALS_CHARGE_SAL1_FEE=false` lets token withdrawals use wallet-paid `SAL1` network fees.
|
||||
- Set `TOKEN_WITHDRAWALS_CHARGE_SAL1_FEE=true` to require and reserve `WITHDRAWAL_FEE` `SAL1` from the user when withdrawing token assets.
|
||||
- `MAX_UNSWEEP_OUTPUTS` defaults to 4 because larger single-run SAL1 fan-outs fail in wallet RPC.
|
||||
- `MAX_TOKEN_UNSWEEP_OUTPUTS` limits token unsweep fan-out per run because token self-transfers also need SAL1 fee transactions.
|
||||
|
||||
## License
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ return [
|
||||
'MIN_WITHDRAWAL_AMOUNT' => 0.4,
|
||||
'WITHDRAWAL_FEE' => 0.1,
|
||||
'TOKEN_WITHDRAWALS_CHARGE_SAL1_FEE' => false,
|
||||
'MAX_UNSWEEP_OUTPUTS' => 100,
|
||||
'MAX_UNSWEEP_OUTPUTS' => 4,
|
||||
'MAX_TOKEN_UNSWEEP_OUTPUTS' => 2,
|
||||
'UNSWEEP_SAL1_FEE_RESERVE' => 0.5,
|
||||
'UNSWEEP_TOKEN_SAL1_FEE_RESERVE' => 0.05,
|
||||
|
||||
@@ -272,7 +272,15 @@ class SalviumTipBotCommands {
|
||||
}
|
||||
|
||||
$maxOutputs = max(2, (int)($this->config['MAX_UNSWEEP_OUTPUTS'] ?? 100));
|
||||
if ($assetType === 'SAL1') {
|
||||
$maxOutputs = min($maxOutputs, 4);
|
||||
}
|
||||
|
||||
if ($outputCount > $maxOutputs) {
|
||||
if ($assetType === 'SAL1') {
|
||||
return "SAL1 unsweep can safely create up to {$maxOutputs} outputs per run. Larger fan-outs fail in wallet RPC.";
|
||||
}
|
||||
|
||||
return "Too many outputs. Max is {$maxOutputs}.";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user