Minor code cleanup.

This commit is contained in:
Kris Nuttycombe 2021-05-14 14:16:10 -06:00
parent bd65b01eb3
commit 8e3e7de50c
2 changed files with 13 additions and 17 deletions

View File

@ -569,23 +569,19 @@ impl<'a, P: consensus::Parameters> WalletWrite for DataConnStmtCache<'a, P> {
// as our z->t tx and store the vouts as our sent notes. // as our z->t tx and store the vouts as our sent notes.
// FIXME this is a weird heuristic that is bound to trip us up somewhere. // FIXME this is a weird heuristic that is bound to trip us up somewhere.
// d_tx.tx.shielded_spends.iter().find(|input| nullifiers.iter().any(|(_, n)| { *n == input.nullifier } )) { if let Some((account_id, _)) = nullifiers.iter().find(|(_, nf)|
d_tx.tx.shielded_spends.iter().any(|input| *nf == input.nullifier)
match nullifiers.iter().find(|(_, n)| d_tx.tx.shielded_spends.iter().any(|input| *n == input.nullifier )) { ) {
Some(tx_input) => {
for (output_index, txout) in d_tx.tx.vout.iter().enumerate() { for (output_index, txout) in d_tx.tx.vout.iter().enumerate() {
wallet::put_sent_utxo( wallet::put_sent_utxo(
up, up,
tx_ref, tx_ref,
output_index, output_index,
tx_input.0, *account_id,
&txout.script_pubkey.address().unwrap(), &txout.script_pubkey.address().unwrap(),
txout.value, txout.value,
)?; )?;
} }
},
None => {
}
} }
} }
Ok(tx_ref) Ok(tx_ref)