update pop blocks

This commit is contained in:
Cryptoforge 2021-03-04 16:54:11 -08:00
parent 62dc6852b3
commit a2966cb9c1

View File

@ -1478,12 +1478,28 @@ impl LightWallet {
{
let mut blks = self.blocks.write().unwrap();
while blks.last().unwrap().height >= at_height {
let mut checking = true;
while checking {
if blks.last().is_none() {
return num_invalidated as u64;
}
if blks.last().unwrap().height >= at_height {
blks.pop();
num_invalidated += 1;
} else {
checking = false;
}
}
// while blks.last().unwrap().height >= at_height {
// blks.pop();
// num_invalidated += 1;
// }
}
// Next, remove entire transactions
{
let mut txs = self.txs.write().unwrap();