private static BigInteger GetHeadIdx() { string msg; string head = RpcHelper.LastBlock(httpClient, creditcoinUrl, out msg); Debug.Assert(head != null && msg == null || head == null && msg != null); if (head == null) { throw new Exception(msg); } BigInteger headIdx; if (!BigInteger.TryParse(head, out headIdx)) { throw new Exception("Invalid numerics"); } return(headIdx); }