It was occupied by the English after the battle of Neville's Cross in 1346, but in 1410 a surprise attack by Patrick Cospatrick, son of the Earl of Dunbar, recaptured it for the Scots.
After destruction by the Duke of Albany in 1515, the castle was re-built by the Homes in 1521. It was taken by the English around 1547, recovered by the Scots, but recaptured by the English in 1570.
After passing, by marriage, to the Logans of Restalrig, it was soon abandoned and became ruinious after their forfeiture in 1600. -- a result of involvement in the Gowrie Conspiracy and increasing bankruptcy.
It was sold to the Douglases in 1602 then passed to the Home Earls of Dunbar, to the Arnots, to the Homes and finally to the Halls.
It was reputedly used by smugglers, having a 'secret'cave below the castle. There are tales of treasure buried there, possibly hidden by Sir Robert Logan of Restalrig, who died in 1606. Walter Scott used the castle in his novel 'Bride of Lammermuir', calling it Wolf's Crag.
Reference above 'The Castles of Scotland by Martin Coventry, Goblinshead 1995/1997.
NOTE---- Nigel covers the history of the Cospatricks in his four books 'Sword of State', 'Envoy Extraordinary', 'Courting favour' and 'End of the Line'.