Title: Fix boinc harvesting function

Description:

    This commit fix the boinc harvesting
function which was not properly working.

    It also add some new fonctionnalities
to the database layer that help to solve
issues in harvesting function and could be
useful for the future.