remove unnecessary option wrapper from gbt return value

This commit is contained in:
Mononaut committed 2023-07-03 10:18:20 -04:00
1 parent 1688b7d24e
commit 702c4c123e
2 files changed
+4 -4

No files matched your search

+3 -3
View File
@@ -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> {
+1 -1
View File
@@ -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