mirror of
https://github.com/Qortal/piratewallet-light-cli.git
synced 2025-01-30 18:42:15 +00:00
Fix crash when insufficient funds
This commit is contained in:
parent
611974c5fa
commit
0e529ba4cd
@ -490,7 +490,8 @@ pub struct SpendableNote {
|
||||
impl SpendableNote {
|
||||
pub fn from(txid: TxId, nd: &SaplingNoteData, anchor_offset: usize, extsk: &ExtendedSpendingKey) -> Option<Self> {
|
||||
// Include only notes that haven't been spent, or haven't been included in an unconfirmed spend yet.
|
||||
if nd.spent.is_none() && nd.unconfirmed_spent.is_none() {
|
||||
if nd.spent.is_none() && nd.unconfirmed_spent.is_none() &&
|
||||
nd.witnesses.len() >= (anchor_offset + 1) {
|
||||
let witness = nd.witnesses.get(nd.witnesses.len() - anchor_offset - 1);
|
||||
|
||||
witness.map(|w| SpendableNote {
|
||||
|
Loading…
Reference in New Issue
Block a user