Add early return to Blockstore::find_address_signatures methods (#33545)
Add early return to find_address_signatures methods
This commit is contained in:
parent
666ce9b3be
commit
6f1922b4fd
|
@ -2474,8 +2474,10 @@ impl Blockstore {
|
||||||
end_slot: Slot,
|
end_slot: Slot,
|
||||||
) -> Result<Vec<(Slot, Signature)>> {
|
) -> Result<Vec<(Slot, Signature)>> {
|
||||||
let (lock, lowest_available_slot) = self.ensure_lowest_cleanup_slot();
|
let (lock, lowest_available_slot) = self.ensure_lowest_cleanup_slot();
|
||||||
|
|
||||||
let mut signatures: Vec<(Slot, Signature)> = vec![];
|
let mut signatures: Vec<(Slot, Signature)> = vec![];
|
||||||
|
if end_slot < lowest_available_slot {
|
||||||
|
return Ok(signatures);
|
||||||
|
}
|
||||||
for transaction_status_cf_primary_index in 0..=1 {
|
for transaction_status_cf_primary_index in 0..=1 {
|
||||||
let index_iterator = self.address_signatures_cf.iter(IteratorMode::From(
|
let index_iterator = self.address_signatures_cf.iter(IteratorMode::From(
|
||||||
(
|
(
|
||||||
|
@ -2511,12 +2513,15 @@ impl Blockstore {
|
||||||
) -> Result<Vec<(Slot, Signature)>> {
|
) -> Result<Vec<(Slot, Signature)>> {
|
||||||
let (lock, lowest_available_slot) = self.ensure_lowest_cleanup_slot();
|
let (lock, lowest_available_slot) = self.ensure_lowest_cleanup_slot();
|
||||||
let mut signatures: Vec<(Slot, Signature)> = vec![];
|
let mut signatures: Vec<(Slot, Signature)> = vec![];
|
||||||
|
if slot < lowest_available_slot {
|
||||||
|
return Ok(signatures);
|
||||||
|
}
|
||||||
for transaction_status_cf_primary_index in 0..=1 {
|
for transaction_status_cf_primary_index in 0..=1 {
|
||||||
let index_iterator = self.address_signatures_cf.iter(IteratorMode::From(
|
let index_iterator = self.address_signatures_cf.iter(IteratorMode::From(
|
||||||
(
|
(
|
||||||
transaction_status_cf_primary_index,
|
transaction_status_cf_primary_index,
|
||||||
pubkey,
|
pubkey,
|
||||||
slot.max(lowest_available_slot),
|
slot,
|
||||||
Signature::default(),
|
Signature::default(),
|
||||||
),
|
),
|
||||||
IteratorDirection::Forward,
|
IteratorDirection::Forward,
|
||||||
|
|
Loading…
Reference in New Issue