public static string GetBlockInfo(long nHeight, string sFieldName, string sNetworkID) { try { object[] oParams = new object[2]; oParams[0] = "subsidy"; oParams[1] = Strings.Trim(nHeight.ToString()); InitializeNewBitnet(sNetworkID); dynamic oOut = mBitnetNewClient.InvokeMethod("run", oParams); string sOut = ""; sOut = oOut["result"][sFieldName].ToString(); return(sOut); } catch (Exception ex) { clsStaticHelper.Log("GET_BLOCK_INFO: " + ex.Message.ToString()); } return(""); }
public void DumpBlocksWithTx(int begin, int end) { for (int i = begin; i < end; i++) { var hash = Bit.InvokeMethod("getblockhash", i)["result"]; var info = Bit.InvokeMethod("getblock", hash)["result"]; Console.WriteLine(info); foreach (var t in info["tx"]) { var txcode = Bit.InvokeMethod("getrawtransaction", t, 1)["result"]; if (txcode == null) { throw new NotSupportedException("apparently doesn't support getrawtransaction. such shitcoin"); } Console.WriteLine(txcode); } } }