Skip to content

Commit

Permalink
fix: skip uncle share if it's missing
Browse files Browse the repository at this point in the history
  • Loading branch information
stringhandler committed Oct 17, 2024
1 parent d8ec0f1 commit 084cd46
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/sharechain/in_memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,12 +351,16 @@ impl ShareChain for InMemoryShareChain {
(MAIN_REWARD_SHARE, new_tip_block.miner_coinbase_extra.clone()),
);
for uncle in new_tip_block.uncles.iter() {
let uncle_block = chain_read_lock
let uncle_block = match chain_read_lock
.get_at_height(uncle.0)
.ok_or_else(|| Error::UncleBlockNotFound)?
.blocks
.get(&uncle.1)
.ok_or_else(|| Error::UncleBlockNotFound)?;
{
Some(v) => v,
None => continue,
};
// .ok_or_else(|| Error::UncleBlockNotFound)?;
miners_to_shares.insert(
uncle_block.miner_wallet_address.to_base58(),
(UNCLE_REWARD_SHARE, uncle_block.miner_coinbase_extra.clone()),
Expand Down

0 comments on commit 084cd46

Please sign in to comment.