Fixed nextinput validation

properly stop nextinput creation when we correctly match the input
correctly hex encode the tx hash index when its > 10