Implement tx upgrading more efficient.

Do the tx database upgrade more efficiently.  Instead of randomly
loading all spending tx's, go through the blockchain in an ordered
fashion instead.