 Sigtrygg realised that Dublin 's wealth made him a target , and that his city needed powerful allies and walls . The Dublin countryside did not provide sufficient resources for competition against powerful Irish princes . Sigtrygg first allied with his maternal uncle , Máel Mórda mac Murchada , King of the Uí <unk> of north Leinster . In 999 , they defeated their cousin the King of Leinster Donnchad mac Domhnaill , and imprisoned him in Dublin . 
