diff options
author | monero-project <sempre.amaro@gmail.com> | 2014-06-11 10:46:56 -0400 |
---|---|---|
committer | monero-project <sempre.amaro@gmail.com> | 2014-06-11 10:46:56 -0400 |
commit | feac5a7b2ddce8f4612ecc459b176518061495b3 (patch) | |
tree | 7362ad472229686631bc906d89a411480240494f | |
parent | Merge pull request #29 from fluffypony/master (diff) | |
download | monero-feac5a7b2ddce8f4612ecc459b176518061495b3.tar.xz |
Correcting high orphan rate of blocks at pool
Diffstat (limited to '')
-rw-r--r-- | src/rpc/core_rpc_server.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp index 03af66f4f..04ed2c687 100644 --- a/src/rpc/core_rpc_server.cpp +++ b/src/rpc/core_rpc_server.cpp @@ -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"; |