Minor lint

This commit is contained in:
Luke Parker 2022-05-19 16:49:45 -04:00
parent 90fccc444b
commit 8945b50988
No known key found for this signature in database
GPG key ID: F9F1386DB1E119B6
2 changed files with 6 additions and 10 deletions

View file

@ -94,15 +94,11 @@ pub fn scan(tx: &Transaction, view: Scalar, spend: EdwardsPoint) -> Vec<Spendabl
let rct_sig = rct_sig.unwrap();
let mut res = vec![];
for o in 0 .. tx.prefix.outputs.len() {
let output_key = if let TxOutTarget::ToKey { key } = tx.prefix.outputs[o].target {
key.point.decompress()
} else { None };
if output_key.is_none() {
continue;
}
let output_key = output_key.unwrap();
for (o, output_key) in tx.prefix.outputs.iter().enumerate().filter_map(
|(o, output)| if let TxOutTarget::ToKey { key } = output.target {
key.point.decompress().map(|output_key| (o, output_key))
} else { None }
) {
// TODO: This may be replaceable by pubkeys[o]
for pubkey in &pubkeys {
// Hs(8Ra || o)

View file

@ -207,7 +207,6 @@ impl StateMachine for TransactionMachine {
tx = self.signable.prepare_transaction(&commitments, bp);
}
let mut rng = ChaCha12Rng::from_seed(self.transcript.rng_seed(b"pseudo_out_masks", None));
for c in 0 .. self.clsags.len() {
// Calculate the key images in order to update the TX
// Multisig will parse/calculate/validate this as needed, yet doing so here as well provides
@ -239,6 +238,7 @@ impl StateMachine for TransactionMachine {
}
sorted.sort_by(|x, y| x.2.compress().to_bytes().cmp(&y.2.compress().to_bytes()).reverse());
let mut rng = ChaCha12Rng::from_seed(self.transcript.rng_seed(b"pseudo_out_masks", None));
let mut sum_pseudo_outs = Scalar::zero();
while sorted.len() != 0 {
let value = sorted.remove(0);