From 21db0defa974cc6dd8e6a4c2de9f18ce5e8d9d32 Mon Sep 17 00:00:00 2001
From: Paul <Paul@Laptop>
Date: Thu, 15 Nov 2018 19:46:17 -0600
Subject: [PATCH 1/4] Add IS parameter for gobject prepare

---
 src/rpc/governance.cpp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/rpc/governance.cpp b/src/rpc/governance.cpp
index 7d4b45892677..07159afab353 100644
--- a/src/rpc/governance.cpp
+++ b/src/rpc/governance.cpp
@@ -132,12 +132,13 @@ void gobject_prepare_help()
                 "2. revision      (numeric, required) object revision in the system\n"
                 "3. time          (numeric, required) time this object was created\n"
                 "4. data-hex      (string, required)  data in hex string form\n"
+                "5. use-IS        (boolean, optional, default=false) InstantSend lock the collateral, only requiring one chain confirmation\n"
                 );
 }
 
 UniValue gobject_prepare(const JSONRPCRequest& request)
 {
-    if (request.fHelp || request.params.size() != 5)
+    if (request.fHelp || (request.params.size() >= 5 && request.params.size() <= 6)) 
         gobject_prepare_help();
 
     if (!EnsureWalletIsAvailable(request.fHelp))
@@ -159,6 +160,8 @@ UniValue gobject_prepare(const JSONRPCRequest& request)
     int nRevision = atoi(strRevision);
     int64_t nTime = atoi64(strTime);
     std::string strDataHex = request.params[4].get_str();
+    bool useIS = false;
+    if (request.params.size > 4) useIS = request.params[5].getBool();
 
     // CREATE A NEW COLLATERAL TRANSACTION FOR THIS SPECIFIC OBJECT
 
@@ -197,7 +200,7 @@ UniValue gobject_prepare(const JSONRPCRequest& request)
     EnsureWalletIsUnlocked();
 
     CWalletTx wtx;
-    if (!pwalletMain->GetBudgetSystemCollateralTX(wtx, govobj.GetHash(), govobj.GetMinCollateralFee(), false)) {
+    if (!pwalletMain->GetBudgetSystemCollateralTX(wtx, govobj.GetHash(), govobj.GetMinCollateralFee(), useIS)) {
         throw JSONRPCError(RPC_INTERNAL_ERROR, "Error making collateral transaction for governance object. Please check your wallet balance and make sure your wallet is unlocked.");
     }
 

From 8ba92f98eefe59562ecc868ef775606668ef8fc9 Mon Sep 17 00:00:00 2001
From: InhumanPerfection <39734219+InhumanPerfection@users.noreply.github.com>
Date: Fri, 16 Nov 2018 06:55:47 -0600
Subject: [PATCH 2/4] Update if statement

Co-Authored-By: PastaPastaPasta <pasta@dashboost.org>
---
 src/rpc/governance.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/rpc/governance.cpp b/src/rpc/governance.cpp
index 07159afab353..2e907c525c6b 100644
--- a/src/rpc/governance.cpp
+++ b/src/rpc/governance.cpp
@@ -161,7 +161,7 @@ UniValue gobject_prepare(const JSONRPCRequest& request)
     int64_t nTime = atoi64(strTime);
     std::string strDataHex = request.params[4].get_str();
     bool useIS = false;
-    if (request.params.size > 4) useIS = request.params[5].getBool();
+    if (request.params.size > 5) useIS = request.params[5].getBool();
 
     // CREATE A NEW COLLATERAL TRANSACTION FOR THIS SPECIFIC OBJECT
 

From 9ee0ddfedd909aedeee4b85bad6a38d6d90c4f52 Mon Sep 17 00:00:00 2001
From: InhumanPerfection <39734219+InhumanPerfection@users.noreply.github.com>
Date: Fri, 16 Nov 2018 11:26:33 -0600
Subject: [PATCH 3/4] Update src/rpc/governance.cpp

Co-Authored-By: PastaPastaPasta <pasta@dashboost.org>
---
 src/rpc/governance.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/rpc/governance.cpp b/src/rpc/governance.cpp
index 2e907c525c6b..718d5fa0e6f9 100644
--- a/src/rpc/governance.cpp
+++ b/src/rpc/governance.cpp
@@ -161,7 +161,7 @@ UniValue gobject_prepare(const JSONRPCRequest& request)
     int64_t nTime = atoi64(strTime);
     std::string strDataHex = request.params[4].get_str();
     bool useIS = false;
-    if (request.params.size > 5) useIS = request.params[5].getBool();
+    if (request.params.size() > 5) useIS = request.params[5].getBool();
 
     // CREATE A NEW COLLATERAL TRANSACTION FOR THIS SPECIFIC OBJECT
 

From b53c4e8c05a07c31cd1d44951e87662e9eb5bd84 Mon Sep 17 00:00:00 2001
From: UdjinM6 <UdjinM6@users.noreply.github.com>
Date: Fri, 16 Nov 2018 11:28:11 -0600
Subject: [PATCH 4/4] Update src/rpc/governance.cpp

Co-Authored-By: PastaPastaPasta <pasta@dashboost.org>
---
 src/rpc/governance.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/rpc/governance.cpp b/src/rpc/governance.cpp
index 718d5fa0e6f9..7c9e7f45a5e8 100644
--- a/src/rpc/governance.cpp
+++ b/src/rpc/governance.cpp
@@ -138,7 +138,7 @@ void gobject_prepare_help()
 
 UniValue gobject_prepare(const JSONRPCRequest& request)
 {
-    if (request.fHelp || (request.params.size() >= 5 && request.params.size() <= 6)) 
+    if (request.fHelp || (request.params.size() != 5 && request.params.size() != 6)) 
         gobject_prepare_help();
 
     if (!EnsureWalletIsAvailable(request.fHelp))
