'Returns a dictionary with some statistics regarding the local trustchain database
:returns a dictionary with statistics'

@blocking_call_on_reactor_thread
def get_statistics(self, public_key=None):

    if (public_key is None):
        public_key = self.my_member.public_key
    latest_block = self.persistence.get_latest(public_key)
    statistics = dict()
    statistics['id'] = public_key.encode('hex')
    interacts = self.persistence.get_num_unique_interactors(public_key)
    statistics['peers_that_pk_helped'] = (interacts[0] if (interacts[0] is not None) else 0)
    statistics['peers_that_helped_pk'] = (interacts[1] if (interacts[1] is not None) else 0)
    if latest_block:
        statistics['total_blocks'] = latest_block.sequence_number
        statistics['total_up'] = latest_block.transaction['total_up']
        statistics['total_down'] = latest_block.transaction['total_down']
        statistics['latest_block'] = dict(latest_block)
        statistics['latest_block']['up'] = latest_block.transaction['up']
        statistics['latest_block']['down'] = latest_block.transaction['down']
    else:
        statistics['total_blocks'] = 0
        statistics['total_up'] = 0
        statistics['total_down'] = 0
    return statistics
