Update to main.cpp

Updated main.cpp block reward code as it was very sloppy from the dev and also fixed a bug in the code where line 877 was missing a } to close off the opening { on line 824