[wallet] TxOrdering, shuffle/bip69 support

This commit is contained in:
Alekos Filini
2020-08-07 15:35:14 +02:00
parent 7005a26fc5
commit 0665c9e854
2 changed files with 133 additions and 11 deletions

View File

@@ -252,12 +252,8 @@ where
return Err(Error::InsufficientFunds); // TODO: or OutputBelowDustLimit?
}
if builder.shuffle_outputs.unwrap_or(true) {
use rand::seq::SliceRandom;
let mut rng = rand::thread_rng();
tx.output.shuffle(&mut rng);
}
// sort input/outputs according to the chosen algorithm
builder.ordering.modify_tx(&mut tx);
let txid = tx.txid();
let mut psbt = PSBT::from_unsigned_tx(tx)?;