Only get Blockstore::last_root once (#16362)
This commit is contained in:
parent
a98467b563
commit
b8b6777262
|
@ -2053,9 +2053,10 @@ impl Blockstore {
|
||||||
"blockstore-rpc-api",
|
"blockstore-rpc-api",
|
||||||
("method", "get_complete_transaction".to_string(), String)
|
("method", "get_complete_transaction".to_string(), String)
|
||||||
);
|
);
|
||||||
|
let last_root = self.last_root();
|
||||||
let confirmed_unrooted_slots: Vec<_> =
|
let confirmed_unrooted_slots: Vec<_> =
|
||||||
AncestorIterator::new_inclusive(highest_confirmed_slot, self)
|
AncestorIterator::new_inclusive(highest_confirmed_slot, self)
|
||||||
.take_while(|&slot| slot > self.last_root())
|
.take_while(|&slot| slot > last_root)
|
||||||
.collect();
|
.collect();
|
||||||
self.get_transaction_with_status(signature, &confirmed_unrooted_slots)
|
self.get_transaction_with_status(signature, &confirmed_unrooted_slots)
|
||||||
}
|
}
|
||||||
|
@ -2213,8 +2214,9 @@ impl Blockstore {
|
||||||
String
|
String
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
let last_root = self.last_root();
|
||||||
let confirmed_unrooted_slots: Vec<_> = AncestorIterator::new_inclusive(highest_slot, self)
|
let confirmed_unrooted_slots: Vec<_> = AncestorIterator::new_inclusive(highest_slot, self)
|
||||||
.take_while(|&slot| slot > self.last_root())
|
.take_while(|&slot| slot > last_root)
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
// Figure the `slot` to start listing signatures at, based on the ledger location of the
|
// Figure the `slot` to start listing signatures at, based on the ledger location of the
|
||||||
|
|
Loading…
Reference in New Issue