Banks use a mix of wholesale and deposit funds to finance lending. If a country is a net importer of wholesale funds, then a financial crisis in a foreign country can 'infect' the banking system by raising the cost of wholesale funds. Indeed, countries such as Australia imported a crisis through the wholesale funding market in the recent global financial crisis. We present a model to show how a rise in the costs of wholesale funding can trigger a crisis in an otherwise healthy banking sector. We also consider a range of government policies, such as 'bailouts', minimum equity requirements, entry restrictions and limits on wholesale funding, that may be deployed to prevent such a crisis. In particular, we focus on the implications of such policies for the structure and level of competition in banking and the rates paid by borrowers and received by depositors, in 'normal times'. We show that some policies, such as minimum equity requirements, can stabilise the banking sector. Other policies, such as licensing, can limit competition but have ambiguous implications for bank stability.