mirror of
https://github.com/Qortal/piratewallet-light-cli.git
synced 2025-01-30 18:42:15 +00:00
update pop blocks
This commit is contained in:
parent
62dc6852b3
commit
a2966cb9c1
@ -1478,12 +1478,28 @@ impl LightWallet {
|
|||||||
{
|
{
|
||||||
let mut blks = self.blocks.write().unwrap();
|
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();
|
blks.pop();
|
||||||
num_invalidated += 1;
|
num_invalidated += 1;
|
||||||
|
} else {
|
||||||
|
checking = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// while blks.last().unwrap().height >= at_height {
|
||||||
|
// blks.pop();
|
||||||
|
// num_invalidated += 1;
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
// Next, remove entire transactions
|
// Next, remove entire transactions
|
||||||
{
|
{
|
||||||
let mut txs = self.txs.write().unwrap();
|
let mut txs = self.txs.write().unwrap();
|
||||||
|
Loading…
Reference in New Issue
Block a user