Skip to content

Commit

Permalink
Applying maxshoendata to asm.hex in getfiltertransaction
Browse files Browse the repository at this point in the history
  • Loading branch information
mike31 committed Oct 23, 2018
1 parent 8ddf2de commit d6fd763
Showing 1 changed file with 35 additions and 3 deletions.
38 changes: 35 additions & 3 deletions src/rpc/rpcrawtransaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ using namespace std;

bool OutputCanSend(COutput out);
uint32_t mc_CheckSigScriptForMutableTx(const unsigned char *src,int size);
int mc_MaxOpReturnShown();

/* MCHN END */

Expand All @@ -58,9 +59,40 @@ void ScriptPubKeyToJSON(const CScript& scriptPubKey, Object& out, bool fIncludeH
if (fIncludeHex)
out.push_back(Pair("hex", HexStr(scriptPubKey.begin(), scriptPubKey.end())));
*/
out.push_back(Pair("asm", scriptToShow.ToString()));
if (fIncludeHex)
out.push_back(Pair("hex", HexStr(scriptToShow.begin(), scriptToShow.end())));

int max_hex_size=-1;
int script_size=(int)(scriptToShow.end()-scriptToShow.begin());

if(mc_gState->m_Features->StreamFilters())
{
if(pMultiChainFilterEngine->m_TxID != 0)
{
max_hex_size=mc_MaxOpReturnShown();
}

if(max_hex_size >= 0)
{
if(script_size <= max_hex_size)
{
max_hex_size=-1;
}
}
}

if(max_hex_size < 0)
{
out.push_back(Pair("asm", scriptToShow.ToString()));
if (fIncludeHex)
out.push_back(Pair("hex", HexStr(scriptToShow.begin(), scriptToShow.end())));
}
else
{
Object script_size_object;
script_size_object.push_back(Pair("size", script_size));
out.push_back(Pair("asm", script_size_object));
if (fIncludeHex)
out.push_back(Pair("hex", script_size_object));
}
/* MCHN END */


Expand Down

0 comments on commit d6fd763

Please sign in to comment.