Hosting + Cleanup
Decided to PR this before things got out of hand.
Was trying to get hosting working, but got distracted and started cleaning up the codebase, because there were a few things I needed to change to make the hosting stuff smoother.
Next thing you know I'm at 400+ 300-.
- Move host walkthrough from home.go to host.go
- merge outputs.go with state.go
- test-long doesn't check for race conditions, test-long-race does, removing the race flag dropping running time from 25s to 6s on my laptop.
- Remove NodeFromID, which was unsafe, replace it with BlockFromID and HeightOfBlock
- move processBlock and processTransaction into their own functions (listen.go now just calls these)
- more comments
- fix a deadlock resulting from CatchUp() calling itself.
And then I did only a little bit of stuff actually related to hosting. Otoh, I think most of the cleanup stuff I did was worth the effort. Maybe my next PR will have more actual hosting lol