If that solved the problem, stick with it.
It could also be the start of some kind of shin splints. I used to get something similar when I had a 15-20 minute walking commute from the train station to work. A few sets of high rep toe raises, to condition the tibialis and ankle musculature, done once or twice a week should help. Toe raise is pictured above, start with no weight to get a feel for the movement (keep the foot forward, not directly under the knee).