diff --git a/src/consensus/pob/miner.rs b/src/consensus/pob/miner.rs index 004d242a4833eed4846556486b7d7d9a53bd0276..944e630a3250709190b0089d02ea3c296210e5e9 100644 --- a/src/consensus/pob/miner.rs +++ b/src/consensus/pob/miner.rs @@ -413,6 +413,7 @@ where let senders = senders.into_iter().unique().collect(); // Added transaction for addresses + tx_index += 1_u8; for transaction in block_for_storage.transactions { tx_index += 1_u8; let receiver = transaction @@ -464,8 +465,8 @@ where } let senders = senders.into_iter().unique().collect(); + bx_index += 1_u8; for behavior in block_for_storage.behaviors { - bx_index += 1_u8; executed_behavior_cursor.append(bx_index, behavior.clone())?; all_bx_addresses_in_block.push(behavior.recover_sender()?); @@ -475,6 +476,7 @@ where pending_behavior_cursor.delete_current()? } } + bx_index += 1_u8; } let addresses_for_bx: Vec<Address> = @@ -497,8 +499,8 @@ where bx_sender_cursor.append(block_number, senders)?; let storage_body = BodyForStorage { - base_tx_id: TxIndex(tx_index.0 - (len as u64) + 1), - base_bx_id: TxIndex(bx_index.0 - (behavior_len as u64) + 1), + base_tx_id: TxIndex(tx_index.0 - 1 - (len as u64)), + base_bx_id: TxIndex(bx_index.0 - 1 - (behavior_len as u64)), tx_amount: len as u64, bx_amount: behavior_len as u64, ommers: Default::default(), //TODO : add real ommers @@ -763,6 +765,7 @@ pub fn clean_bx_pool<SE: EnvironmentKind>( let (index, behavior) = value.unwrap().unwrap(); if check_behavior_expiration(block_spec, now.clone(), behavior.behavior.clone()) .is_err() + || behavior.input.is_empty() { pending_behavior_cursor .seek(index) diff --git a/src/stages/bodies.rs b/src/stages/bodies.rs index 1f911c74a6807712d0cb38f46cfc38c1478542fa..6c1266659b5c53aec88dadfd25fe5d6dd9afb66a 100644 --- a/src/stages/bodies.rs +++ b/src/stages/bodies.rs @@ -343,7 +343,6 @@ impl BodyDownload { } } - /* May be useful later but atm just takes longer to do nothing ?? if send_cycle_successful { send_interval = std::cmp::max( send_interval.saturating_sub(INTERVAL_TWEAK_STEP), @@ -357,7 +356,6 @@ impl BodyDownload { ); debug!("Request cycle interval increased to {send_interval:?}"); } -*/ session.pending_responses.lock().clear(); } }