mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 20:29:23 +00:00
Optimize decoy selection
Saves roughly 0.8s when running the tests, which took 16.6s and now take 15.8 (5%). Removes the larger sample size, which replaced the closest selected decoy with the real spend, per advice of Rucknium.
This commit is contained in:
@@ -113,6 +113,15 @@ async fn send_core(test: usize, multisig: bool) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// We actually need 80 decoys for this transaction, so mine until then
|
||||
// 80 + 60 (miner TX maturity) + 10 (lock blocks)
|
||||
// It is possible for this to be lower, by noting maturity is sufficient regardless of lock
|
||||
// blocks, yet that's not currently implemented
|
||||
// TODO, if we care
|
||||
while rpc.get_height().await.unwrap() < 160 {
|
||||
mine_block(&rpc, &addr.to_string()).await.unwrap();
|
||||
}
|
||||
|
||||
for i in (start + 1) .. (start + 9) {
|
||||
let tx = rpc.get_block_transactions(i).await.unwrap().swap_remove(0);
|
||||
let output = tx.scan(view, spend_pub).swap_remove(0);
|
||||
|
||||
Reference in New Issue
Block a user