public static bool gobject_submit(bool fTestNet, string sID, int nProposalTimeStamp, string sHex, string sPrepareTXID) { try { if (sPrepareTXID == "") { return(false); } // Submit the gobject to the network - gobject submit parenthash revision time datahex collateraltxid string sArgs = "0 1 " + nProposalTimeStamp.ToString() + " " + sHex + " " + sPrepareTXID; string sCmd1 = "gobject submit " + sArgs; object[] oParams = new object[6]; oParams[0] = "submit"; oParams[1] = "0"; oParams[2] = "1"; oParams[3] = nProposalTimeStamp.ToString(); oParams[4] = sHex; oParams[5] = sPrepareTXID; NBitcoin.RPC.RPCClient n = fTestNet ? WebRPC.GetTestNetRPCClient() : WebRPC.GetLocalRPCClient(); dynamic oOut = n.SendCommand("gobject", oParams); string sSubmitTXID = oOut.Result.ToString(); if (sSubmitTXID.Length > 20) { // Update the record allowing us to know this has been submitted string sql = "Update Proposal set Submitted=GetDate(),SubmitTXID='" + sSubmitTXID + "' where id = '" + sID + "'"; Common.gData.Exec(sql); return(true); } return(false); } catch (Exception ex) { return(false); } }
public static void gobject_prepare(bool fTestNet, string sID, int StartTimeStamp, string sHex) { // gobject prepare string sArgs = "0 1 " + StartTimeStamp.ToString() + " " + sHex; string sCmd1 = "gobject prepare " + sArgs; object[] oParams = new object[5]; oParams[0] = "prepare"; oParams[1] = "0"; oParams[2] = "1"; oParams[3] = StartTimeStamp.ToString(); oParams[4] = sHex; NBitcoin.RPC.RPCClient n = fTestNet ? WebRPC.GetTestNetRPCClient() : WebRPC.GetLocalRPCClient(); dynamic oOut = n.SendCommand("gobject", oParams); string sPrepareTXID = oOut.Result.ToString(); string sql4 = "Update Proposal Set PrepareTxId='" + sPrepareTXID + "',Updated=getdate() where id = '" + sID + "'"; Common.gData.Exec(sql4); }