spend: scale down the number of BnB when not compiling with optimizations
This commit is contained in:
parent
f18086c152
commit
c002ab9579
@ -312,12 +312,15 @@ fn select_coins_for_spend(
|
||||
lowest_fee,
|
||||
must_have_change,
|
||||
};
|
||||
// Scale down the number of rounds to perform if there is too many candidates.
|
||||
// Scale down the number of rounds to perform if there is too many candidates. If the binary
|
||||
// isn't optimized, scale it down further to avoid lags in hot loops.
|
||||
let bnb_rounds = match candidate_coins.len() {
|
||||
i if i >= 500 => 1_000,
|
||||
i if i >= 100 => 10_000,
|
||||
_ => 100_000,
|
||||
};
|
||||
#[cfg(debug)]
|
||||
let bnb_rounds = bnb_rounds / 1_000;
|
||||
if let Err(e) = selector.run_bnb(lowest_fee_change_cond, bnb_rounds) {
|
||||
log::warn!(
|
||||
"Coin selection error: '{}'. Selecting coins by descending value per weight unit...",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user