@@ -320,7 +320,7 @@ static void SignSpecialTxPayloadByHash(const CMutableTransaction& tx, SpecialTxP
320320 payload.sig = key.Sign (hash, use_legacy);
321321}
322322
323- static std::string SignAndSendSpecialTx (const JSONRPCRequest& request, CChainstateHelper& chain_helper, const ChainstateManager& chainman, const CMutableTransaction& tx, bool fSubmit = true )
323+ static std::string SignAndSendSpecialTx (const JSONRPCRequest& request, CChainstateHelper& chain_helper, const ChainstateManager& chainman, const CMutableTransaction& tx, bool fSubmit )
324324{
325325 {
326326 LOCK (cs_main);
@@ -539,9 +539,9 @@ static RPCHelpMan protx_register_fund_evo()
539539 },
540540 {
541541 RPCResult{" if \" submit\" is not set or set to true" ,
542- RPCResult::Type::STR_HEX, " txid" , " The transaction id" },
542+ RPCResult::Type::STR_HEX, " txid" , " The transaction id" },
543543 RPCResult{" if \" submit\" is set to false" ,
544- RPCResult::Type::STR_HEX, " hex" , " The serialized signed ProTx in hex format" },
544+ RPCResult::Type::STR_HEX, " hex" , " The serialized signed ProTx in hex format" },
545545 },
546546 RPCExamples{
547547 HelpExampleCli (" protx" , " register_fund_evo \" " + EXAMPLE_ADDRESS[0 ] + " \" \" 1.2.3.4:1234\" \" " + EXAMPLE_ADDRESS[1 ] + " \" \" 93746e8731c57f87f79b3620a7982924e2931717d49540a85864bd543de11c43fb868fd63e501a1db37e19ed59ae6db4\" \" " + EXAMPLE_ADDRESS[1 ] + " \" 0 \" " + EXAMPLE_ADDRESS[0 ] + " \" \" f2dbd9b0a1f541a7c44d34a58674d0262f5feca5\" 22821 22822" )},
@@ -578,9 +578,9 @@ static RPCHelpMan protx_register_evo()
578578 },
579579 {
580580 RPCResult{" if \" submit\" is not set or set to true" ,
581- RPCResult::Type::STR_HEX, " txid" , " The transaction id" },
581+ RPCResult::Type::STR_HEX, " txid" , " The transaction id" },
582582 RPCResult{" if \" submit\" is set to false" ,
583- RPCResult::Type::STR_HEX, " hex" , " The serialized signed ProTx in hex format" },
583+ RPCResult::Type::STR_HEX, " hex" , " The serialized signed ProTx in hex format" },
584584 },
585585 RPCExamples{
586586 HelpExampleCli (" protx" , " register_evo \" 0123456701234567012345670123456701234567012345670123456701234567\" 0 \" 1.2.3.4:1234\" \" " + EXAMPLE_ADDRESS[1 ] + " \" \" 93746e8731c57f87f79b3620a7982924e2931717d49540a85864bd543de11c43fb868fd63e501a1db37e19ed59ae6db4\" \" " + EXAMPLE_ADDRESS[1 ] + " \" 0 \" " + EXAMPLE_ADDRESS[0 ] + " \" \" f2dbd9b0a1f541a7c44d34a58674d0262f5feca5\" 22821 22822" )},
@@ -885,7 +885,7 @@ static RPCHelpMan protx_register_submit()
885885 ptx.vchSig = opt_vchSig.value ();
886886
887887 SetTxPayload (tx, ptx);
888- return SignAndSendSpecialTx (request, chain_helper, chainman, tx);
888+ return SignAndSendSpecialTx (request, chain_helper, chainman, tx, /* fSubmit= */ true );
889889},
890890 };
891891}
@@ -903,9 +903,13 @@ static RPCHelpMan protx_update_service()
903903 GetRpcArg (" operatorKey" ),
904904 GetRpcArg (" operatorPayoutAddress" ),
905905 GetRpcArg (" feeSourceAddress" ),
906+ GetRpcArg (" submit" ),
906907 },
907- RPCResult{
908- RPCResult::Type::STR_HEX, " txid" , " The transaction id"
908+ {
909+ RPCResult{" if \" submit\" is not set or set to true" ,
910+ RPCResult::Type::STR_HEX, " txid" , " The transaction id" },
911+ RPCResult{" if \" submit\" is set to false" ,
912+ RPCResult::Type::STR_HEX, " hex" , " The serialized signed ProTx in hex format" },
909913 },
910914 RPCExamples{
911915 HelpExampleCli (" protx" , " update_service \" 0123456701234567012345670123456701234567012345670123456701234567\" \" 1.2.3.4:1234\" 5a2e15982e62f1e0b7cf9783c64cf7e3af3f90a52d6c40f6f95d624c0b1621cd" )
@@ -935,9 +939,14 @@ static RPCHelpMan protx_update_service_evo()
935939 GetRpcArg (" platformHTTPPort" ),
936940 GetRpcArg (" operatorPayoutAddress" ),
937941 GetRpcArg (" feeSourceAddress" ),
942+ GetRpcArg (" submit" ),
943+ },
944+ {
945+ RPCResult{" if \" submit\" is not set or set to true" ,
946+ RPCResult::Type::STR_HEX, " txid" , " The transaction id" },
947+ RPCResult{" if \" submit\" is set to false" ,
948+ RPCResult::Type::STR_HEX, " hex" , " The serialized signed ProTx in hex format" },
938949 },
939- RPCResult{
940- RPCResult::Type::STR_HEX, " txid" , " The transaction id" },
941950 RPCExamples{
942951 HelpExampleCli (" protx" , " update_service_evo \" 0123456701234567012345670123456701234567012345670123456701234567\" \" 1.2.3.4:1234\" \" 5a2e15982e62f1e0b7cf9783c64cf7e3af3f90a52d6c40f6f95d624c0b1621cd\" \" f2dbd9b0a1f541a7c44d34a58674d0262f5feca5\" 22821 22822" )},
943952 [&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
@@ -1043,14 +1052,19 @@ static UniValue protx_update_service_common_wrapper(const JSONRPCRequest& reques
10431052 }
10441053 }
10451054
1055+ bool fSubmit {true };
1056+ if (!request.params [paramIdx + 2 ].isNull ()) {
1057+ fSubmit = ParseBoolV (request.params [paramIdx + 2 ], " submit" );
1058+ }
1059+
10461060 FundSpecialTx (*wallet, tx, ptx, feeSource);
10471061
10481062 const bool isV19active = DeploymentActiveAfter (WITH_LOCK (cs_main, return chainman.ActiveChain ().Tip ();),
10491063 Params ().GetConsensus (), Consensus::DEPLOYMENT_V19);
10501064 SignSpecialTxPayloadByHash (tx, ptx, keyOperator, !isV19active);
10511065 SetTxPayload (tx, ptx);
10521066
1053- return SignAndSendSpecialTx (request, chain_helper, chainman, tx);
1067+ return SignAndSendSpecialTx (request, chain_helper, chainman, tx, fSubmit );
10541068}
10551069
10561070static RPCHelpMan protx_update_registrar_wrapper (const bool specific_legacy_bls_scheme)
@@ -1070,9 +1084,13 @@ static RPCHelpMan protx_update_registrar_wrapper(const bool specific_legacy_bls_
10701084 GetRpcArg (" votingAddress_update" ),
10711085 GetRpcArg (" payoutAddress_update" ),
10721086 GetRpcArg (" feeSourceAddress" ),
1087+ GetRpcArg (" submit" ),
10731088 },
1074- RPCResult{
1075- RPCResult::Type::STR_HEX, " txid" , " The transaction id"
1089+ {
1090+ RPCResult{" if \" submit\" is not set or set to true" ,
1091+ RPCResult::Type::STR_HEX, " txid" , " The transaction id" },
1092+ RPCResult{" if \" submit\" is set to false" ,
1093+ RPCResult::Type::STR_HEX, " hex" , " The serialized signed ProTx in hex format" },
10761094 },
10771095 RPCExamples{
10781096 HelpExampleCli (" protx" , rpc_example)
@@ -1149,11 +1167,16 @@ static RPCHelpMan protx_update_registrar_wrapper(const bool specific_legacy_bls_
11491167 throw JSONRPCError (RPC_INVALID_ADDRESS_OR_KEY, std::string (" Invalid Dash address: " ) + request.params [4 ].get_str ());
11501168 }
11511169
1170+ bool fSubmit {true };
1171+ if (!request.params [5 ].isNull ()) {
1172+ fSubmit = ParseBoolV (request.params [5 ], " submit" );
1173+ }
1174+
11521175 FundSpecialTx (*wallet, tx, ptx, feeSourceDest);
11531176 SignSpecialTxPayloadByHash (tx, ptx, dmn->pdmnState ->keyIDOwner , *wallet);
11541177 SetTxPayload (tx, ptx);
11551178
1156- return SignAndSendSpecialTx (request, chain_helper, chainman, tx);
1179+ return SignAndSendSpecialTx (request, chain_helper, chainman, tx, fSubmit );
11571180},
11581181 };
11591182}
@@ -1181,9 +1204,13 @@ static RPCHelpMan protx_revoke()
11811204 GetRpcArg (" operatorKey" ),
11821205 GetRpcArg (" reason" ),
11831206 GetRpcArg (" feeSourceAddress" ),
1207+ GetRpcArg (" submit" ),
11841208 },
1185- RPCResult{
1186- RPCResult::Type::STR_HEX, " txid" , " The transaction id"
1209+ {
1210+ RPCResult{" if \" submit\" is not set or set to true" ,
1211+ RPCResult::Type::STR_HEX, " txid" , " The transaction id" },
1212+ RPCResult{" if \" submit\" is set to false" ,
1213+ RPCResult::Type::STR_HEX, " hex" , " The serialized signed ProTx in hex format" },
11871214 },
11881215 RPCExamples{
11891216 HelpExampleCli (" protx" , " revoke \" 0123456701234567012345670123456701234567012345670123456701234567\" \" 072f36a77261cdd5d64c32d97bac417540eddca1d5612f416feb07ff75a8e240\" " )
@@ -1248,10 +1275,15 @@ static RPCHelpMan protx_revoke()
12481275 throw JSONRPCError (RPC_INTERNAL_ERROR, " No payout or fee source addresses found, can't revoke" );
12491276 }
12501277
1278+ bool fSubmit {true };
1279+ if (!request.params [4 ].isNull ()) {
1280+ fSubmit = ParseBoolV (request.params [4 ], " submit" );
1281+ }
1282+
12511283 SignSpecialTxPayloadByHash (tx, ptx, keyOperator, !isV19active);
12521284 SetTxPayload (tx, ptx);
12531285
1254- return SignAndSendSpecialTx (request, chain_helper, chainman, tx);
1286+ return SignAndSendSpecialTx (request, chain_helper, chainman, tx, fSubmit );
12551287},
12561288 };
12571289}
0 commit comments