mirror of
https://github.com/mempool/mempool.git
synced 2025-02-22 14:22:44 +01:00
remove unnecessary option wrapper from gbt return value
This commit is contained in:
parent
1688b7d24e
commit
702c4c123e
2 changed files with 4 additions and 4 deletions
|
@ -55,7 +55,7 @@ impl Ord for TxPriority {
|
|||
// TODO: Make gbt smaller to fix these lints.
|
||||
#[allow(clippy::too_many_lines)]
|
||||
#[allow(clippy::cognitive_complexity)]
|
||||
pub fn gbt(mempool: &mut ThreadTransactionsMap) -> Option<GbtResult> {
|
||||
pub fn gbt(mempool: &mut ThreadTransactionsMap) -> GbtResult {
|
||||
let mut audit_pool: AuditPool = u32hashmap_with_capacity(STARTING_CAPACITY);
|
||||
let mut mempool_stack: Vec<u32> = Vec::with_capacity(STARTING_CAPACITY);
|
||||
let mut clusters: Vec<Vec<u32>> = Vec::new();
|
||||
|
@ -207,11 +207,11 @@ pub fn gbt(mempool: &mut ThreadTransactionsMap) -> Option<GbtResult> {
|
|||
}
|
||||
}
|
||||
|
||||
Some(GbtResult {
|
||||
GbtResult {
|
||||
blocks,
|
||||
clusters,
|
||||
rates,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
fn next_valid_from_stack<'a>(mempool_stack: &mut Vec<u32>, audit_pool: &'a AuditPool) -> Option<&'a AuditTransaction> {
|
||||
|
|
|
@ -110,7 +110,7 @@ where
|
|||
.lock()
|
||||
.map_err(|_| napi::Error::from_reason("THREAD_TRANSACTIONS Mutex poisoned"))?;
|
||||
callback(&mut map);
|
||||
gbt::gbt(&mut map).ok_or_else(|| napi::Error::from_reason("gbt failed"))
|
||||
Ok(gbt::gbt(&mut map))
|
||||
});
|
||||
|
||||
handle
|
||||
|
|
Loading…
Add table
Reference in a new issue