A joint transmitter-receiver energy harvesting model is considered, where both the transmitter and receiver are powered by (renewable) energy harvesting source. EH gives rise to instantaneous energy neutrality constraint, i.e. energy consumed till any time cannot be more than the total accumulated energy. Assuming no information about future energy arrivals, the goal is to find an optimal 'online algorithm'. In this work, both optimal offline and optimal online policies are derived. The optimal online policy is shown to be two-competitive in the arbitrary input case.