My guess:
Failure probably is in CBlock::ConnectBlock() at line 1319.
nFees is initailized at 0, never changed and then vtx[0].getValueOut is checked against GetBlockValue(pindex->nHeight, nFees), since nFees == 0 this silently fails.
Edit:
keypool keep 882
InvalidChainFound: invalid block=7ee9a9e1ff1ffc925894 height=39735 work=216983967497595029143
InvalidChainFound: current best=77c39192bb4a4a8a88f2 height=39734 work=216897912273401034588
ERROR: SetBestChain() : ConnectBlock failed
ERROR: AcceptBlock() : AddToBlockIndex failed
ERROR: ProcessBlock() : AcceptBlock FAILED
ERROR: BitcoinMiner : ProcessBlock, block not accepted
As can be seen here: CBlock::SetBestChain() craps out at if(!ConnectBlock()) at line 1451. First visible error is from InvalidChainFound(), so ConnectBlock() fails silently (could also be txdb.Write(), but seems unlikely).
Edit2: mmmm, if nFees really doesn't get updated, why doesn't this function fail more often?
thanks for the response, much appreciated
seems not the issue, and could be the buggy tx is no longer in the memory pool - asking pools if they have had any issues since
nFees is updated properly and if there was such an bug, all blocks would fail as you pointed out
I've been running a dummy miner (with minimum difficulty for 10 hours) and the error never happened. Maybe the buggy tx stopped broadcasting and is not in the memory pool anymore.
Will be an update to fix name/death/chat bug -- Miners must upgrade last -- (have messaged pools)
Also I added more debug messages into ConnectBlock and related functions, hopefully it'll help to locate the problem.