Many castles still retained a defensive role. Castles in England, such as Chepstow and York Castle, were repaired and garrisoned by the king. As military technologies progressed the costs of upgrading older castles could be prohibitive – the estimated £30,000 required for the potential conversion of York in 1682, approximately £4,050,000 in 2009 terms, gives a scale of the potential costs. Castles played a minimal role in the Glorious Revolution of 1688, although some fortifications such as Dover Castle were attacked by mobs unhappy with the religious beliefs of their Catholic governors, and the sieges of King John's Castle in Limerick formed part of the endgame to the war in Ireland. In the north of Britain security problems persisted in Scotland. Cromwellian forces had built a number of new modern forts and barracks, but the royal castles of Edinburgh, Dumbarton and Stirling, along with Dunstaffnage, Dunollie and Ruthven Castle, also continued in use as practical fortifications. Tower houses were being built until the 1640s; after the Restoration the fortified tower house fell out of fashion, but the weak state of the Scottish economy was such that while many larger properties were simply abandoned, the more modest castles continued to be used and adapted as houses, rather than rebuilt. In Ireland tower houses and castles remained in use until after the Glorious Revolution, when events led to a dramatic shift in land ownership and a boom in the building of Palladian country houses; in many cases using timbers stripped from the older, abandoned generation of castles and tower houses.