tidy up bitswap, ledger

Now that i think about it, this needs to be protected by some locks. its not threadsafe.