King James IV supported Perkin Warbeck in 1495, which made things incredibly tense and it felt like war with Scotland was inevitable. However, in 1497, James became seemed to be more reluctant to support Warbeck (potentially to do with Warbeck being horrified by Scottish brutality in their invasion) and made a peace treaty in 1502 - Treaty of Ayton - with King Henry.