Fix giving and receiving amounts

Fixes #1127, and a few other bugs (including the 4th item of #2630).
The alternative is to have a `current_tips` table and store `is_funded` in there, but that's not a simple thing to implement.