mirror of
https://github.com/Qortal/piratewallet-light-cli.git
synced 2025-02-01 03:12:15 +00:00
fix crash on single unspent note
This commit is contained in:
parent
ea64467363
commit
ae09cb3707
@ -1363,21 +1363,26 @@ impl LightWallet {
|
|||||||
for spend in &tx.shielded_spends {
|
for spend in &tx.shielded_spends {
|
||||||
let txid = nfs
|
let txid = nfs
|
||||||
.iter()
|
.iter()
|
||||||
.find(|(nf, _, _)| &nf[..] == &spend.nullifier[..])
|
.find(|(nf, _, _)| &nf[..] == &spend.nullifier[..]);
|
||||||
.unwrap()
|
|
||||||
.2;
|
match txid {
|
||||||
let spent_note = txs
|
Some(id) => {
|
||||||
.get_mut(&txid)
|
let spent_note = txs
|
||||||
.unwrap()
|
.get_mut(&id.2)
|
||||||
.notes
|
.unwrap()
|
||||||
.iter_mut()
|
.notes
|
||||||
.find(|nd| &nd.nullifier[..] == &spend.nullifier[..])
|
.iter_mut()
|
||||||
.unwrap();
|
.find(|nd| &nd.nullifier[..] == &spend.nullifier[..])
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
|
zinputs.push(encode_payment_address(
|
||||||
|
self.config.hrp_sapling_address(),
|
||||||
|
&spent_note.extfvk.fvk.vk
|
||||||
|
.to_payment_address(spent_note.diversifier, &JUBJUB).unwrap()))
|
||||||
|
},
|
||||||
|
None => {}
|
||||||
|
};
|
||||||
|
|
||||||
zinputs.push(encode_payment_address(
|
|
||||||
self.config.hrp_sapling_address(),
|
|
||||||
&spent_note.extfvk.fvk.vk
|
|
||||||
.to_payment_address(spent_note.diversifier, &JUBJUB).unwrap()));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user