potential fix for peer not disconnecting after invalid block
This commit is contained in:
parent
f7980f5252
commit
6b915054d2
3 changed files with 6 additions and 5 deletions
|
|
@ -55,8 +55,6 @@ void account_statistics_object::process_fees(const account_object& a, database&
|
||||||
{
|
{
|
||||||
if( pending_fees > 0 || pending_vested_fees > 0 )
|
if( pending_fees > 0 || pending_vested_fees > 0 )
|
||||||
{
|
{
|
||||||
const auto& props = d.get_global_properties();
|
|
||||||
|
|
||||||
auto pay_out_fees = [&](const account_object& account, share_type core_fee_total, bool require_vesting)
|
auto pay_out_fees = [&](const account_object& account, share_type core_fee_total, bool require_vesting)
|
||||||
{
|
{
|
||||||
// Check the referrer -- if he's no longer a member, pay to the lifetime referrer instead.
|
// Check the referrer -- if he's no longer a member, pay to the lifetime referrer instead.
|
||||||
|
|
|
||||||
|
|
@ -129,7 +129,7 @@ block_id_type block_database::fetch_block_id( uint32_t block_num )const
|
||||||
index_entry e;
|
index_entry e;
|
||||||
auto index_pos = sizeof(e)*block_num;
|
auto index_pos = sizeof(e)*block_num;
|
||||||
_block_num_to_pos.seekg( 0, _block_num_to_pos.end );
|
_block_num_to_pos.seekg( 0, _block_num_to_pos.end );
|
||||||
if ( _block_num_to_pos.tellg() <= index_pos )
|
if ( _block_num_to_pos.tellg() <= int64_t(index_pos) )
|
||||||
FC_THROW_EXCEPTION(fc::key_not_found_exception, "Block number ${block_num} not contained in block database", ("block_num", block_num));
|
FC_THROW_EXCEPTION(fc::key_not_found_exception, "Block number ${block_num} not contained in block database", ("block_num", block_num));
|
||||||
|
|
||||||
_block_num_to_pos.seekg( index_pos );
|
_block_num_to_pos.seekg( index_pos );
|
||||||
|
|
|
||||||
|
|
@ -3323,10 +3323,13 @@ namespace graphene { namespace net { namespace detail {
|
||||||
|
|
||||||
disconnect_exception = e;
|
disconnect_exception = e;
|
||||||
disconnect_reason = "You offered me a block that I have deemed to be invalid";
|
disconnect_reason = "You offered me a block that I have deemed to be invalid";
|
||||||
|
|
||||||
|
peers_to_disconnect.push_back( originating_peer->shared_from_this() );
|
||||||
|
/* This loop fails do disconnect the originating peer
|
||||||
for (const peer_connection_ptr& peer : _active_connections)
|
for (const peer_connection_ptr& peer : _active_connections)
|
||||||
if (!peer->ids_of_items_to_get.empty() &&
|
if (!peer->ids_of_items_to_get.empty() && peer->ids_of_items_to_get.front() == block_message_to_process.block_id)
|
||||||
peer->ids_of_items_to_get.front() == block_message_to_process.block_id)
|
|
||||||
peers_to_disconnect.push_back(peer);
|
peers_to_disconnect.push_back(peer);
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
for (const peer_connection_ptr& peer : peers_to_disconnect)
|
for (const peer_connection_ptr& peer : peers_to_disconnect)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue