add --accounts-index-scan-results-limit-mb to allow scans to abort (#21327)
* ScanConfig -> &ScanConfig * add --accounts-index-scan-results-limit-mb to allow scans to abort * feedback
This commit is contained in:
committed by
GitHub
parent
48dfdfb4d5
commit
79d21d6805
@ -1840,14 +1840,16 @@ impl JsonRpcRequestProcessor {
|
||||
// accounts.
|
||||
account.owner() == program_id && filter_closure(account)
|
||||
},
|
||||
ScanConfig::default(),
|
||||
&ScanConfig::default(),
|
||||
bank.byte_limit_for_scans(),
|
||||
)
|
||||
.map_err(|e| RpcCustomError::ScanError {
|
||||
message: e.to_string(),
|
||||
})?)
|
||||
} else {
|
||||
// this path does not need to provide a mb limit because we only want to support secondary indexes
|
||||
Ok(bank
|
||||
.get_filtered_program_accounts(program_id, filter_closure, ScanConfig::default())
|
||||
.get_filtered_program_accounts(program_id, filter_closure, &ScanConfig::default())
|
||||
.map_err(|e| RpcCustomError::ScanError {
|
||||
message: e.to_string(),
|
||||
})?)
|
||||
@ -1901,7 +1903,8 @@ impl JsonRpcRequestProcessor {
|
||||
}
|
||||
})
|
||||
},
|
||||
ScanConfig::default(),
|
||||
&ScanConfig::default(),
|
||||
bank.byte_limit_for_scans(),
|
||||
)
|
||||
.map_err(|e| RpcCustomError::ScanError {
|
||||
message: e.to_string(),
|
||||
@ -1957,7 +1960,8 @@ impl JsonRpcRequestProcessor {
|
||||
}
|
||||
})
|
||||
},
|
||||
ScanConfig::default(),
|
||||
&ScanConfig::default(),
|
||||
bank.byte_limit_for_scans(),
|
||||
)
|
||||
.map_err(|e| RpcCustomError::ScanError {
|
||||
message: e.to_string(),
|
||||
|
Reference in New Issue
Block a user