Gallows Thief by Bernard Cornwell
1820s Britain: after the wars with France, when unemployment was high and soldiers could be paid off, when the government was desperately afraid of social unrest, any crime was drastically punished and thousands were hung. But one could petition the King and an investigation might ensue...
The man in the dark cell in Newgate Prison was due to hang in a week. He had been found guilty of murdering the aristocrat whose portrait he was painting. He claimed to be innocent - but then the hangman had never hung a guilty man, he said. But even in 1820, the Home Secretary could occasionally use his powers to grant mercy if his investigator found cause and Rider Sandman, once of the First Foot Guards, is given the job, since justice must be seen to be done as the accused man's mother is seamstress to the Queen.
Rider Sandman, a hero of Waterloo, has family debts to repay but when his first steps in the investigations produce a sizeable bribe to look the other way, this only arouses his smouldering anger over the condition of England, a country which he and others in Wellington's army had fought to preserve. Stepping between gentlemen's clubs and taverns, talking to aristocrats, fashionable painters, their models, and their mistresses, dodging professional cut-throats and deceptive swordsmen, Sandman uncovers a conspiracy of silence, a group whose proudest boast was that they would do anything for any one of them.
Sandman is a wonderful character, as yet undaunted by the sleazy streets, dank jails or the looming scaffold, and uncorrupted by politicians, sneering gentlemen or frightening bruisers, an investigator in the making and a brilliant, but very different, hero for all Bernard Cornwell fans.