Skip to content

Commit

Permalink
Correcting high orphan rate of blocks at pool
Browse files Browse the repository at this point in the history
  • Loading branch information
monero-project committed Jun 11, 2014
1 parent 2d755b3 commit feac5a7
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/rpc/core_rpc_server.cpp
Expand Up @@ -438,9 +438,18 @@ namespace cryptonote
error_resp.message = "Wrong block blob";
return false;
}
cryptonote::block_verification_context bvc = AUTO_VAL_INIT(bvc);
m_core.handle_incoming_block(blockblob, bvc);
if(!bvc.m_added_to_main_chain)

// Fixing of high orphan issue for most pools
// Thanks Boolberry!
block b = AUTO_VAL_INIT(b);
if(!parse_and_validate_block_from_blob(blockblob, b))
{
error_resp.code = CORE_RPC_ERROR_CODE_WRONG_BLOCKBLOB;
error_resp.message = "Wrong block blob";
return false;
}

if(!m_core.handle_block_found(b))
{
error_resp.code = CORE_RPC_ERROR_CODE_BLOCK_NOT_ACCEPTED;
error_resp.message = "Block not accepted";
Expand Down

0 comments on commit feac5a7

Please sign in to comment.