Honestly, I didn't look at this earlier because I looked who authored the github repo, and I know you are a decent dev. I've never seen the OP, so I'm to assume he bought the code from you? Or are you just answering for him?
In such a case, you missed the other post where I asked some rather basic questions, so I'll just ask these for everyone's sake:
Is the staking correct or not?Did you run a testnet?There is no reason to assign a const to a volatile variable that is left unchanged, and there is no reason to convert to satoshi, then back to COIN, then return the result. Besides wasting cpu cycles. Futhermore, if the value is already in satoshis, which is what nSubsidy is (satoshis, not a float), why the fuck are we then converting back to COIN format(/ COIN)? So, despite being some sloppy half-assed copy/paste code with no git history regarding what history the code has, is the staking correct or not?
We would prefer some real answers other than "I think the code is okay *presents 5th-grade arithmetic*"