Minor code cleanup.
This commit is contained in:
parent
bd65b01eb3
commit
8e3e7de50c
|
@ -57,7 +57,7 @@ where
|
||||||
.ok_or(Error::SaplingNotActive)?;
|
.ok_or(Error::SaplingNotActive)?;
|
||||||
|
|
||||||
let sapling_outputs = decrypt_transaction(params, height, tx, &extfvks);
|
let sapling_outputs = decrypt_transaction(params, height, tx, &extfvks);
|
||||||
|
|
||||||
if !(sapling_outputs.is_empty() && tx.vout.is_empty()) {
|
if !(sapling_outputs.is_empty() && tx.vout.is_empty()) {
|
||||||
let nullifiers = data.get_all_nullifiers()?;
|
let nullifiers = data.get_all_nullifiers()?;
|
||||||
data.store_decrypted_tx(
|
data.store_decrypted_tx(
|
||||||
|
|
|
@ -569,22 +569,18 @@ 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,
|
*account_id,
|
||||||
tx_input.0,
|
&txout.script_pubkey.address().unwrap(),
|
||||||
&txout.script_pubkey.address().unwrap(),
|
txout.value,
|
||||||
txout.value,
|
)?;
|
||||||
)?;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
None => {
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue