Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.0 alpha 4 release #69

Merged
merged 160 commits into from
Aug 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
160 commits
Select commit Hold shift + click to select a range
c1fb174
Merge pull request #46 from MultiChain/2.0-release
mike31 Jan 29, 2018
a8c880c
sendrawtransaction message when conflicting with memppol
mike31 Feb 1, 2018
76a01b4
Refactored AcceptMultiChainTransaction
mike31 Feb 6, 2018
0b74405
Deprecated protocols 10004-10007
mike31 Feb 8, 2018
a968425
Fixed -shortoutput message
mike31 Feb 14, 2018
c8386c1
Off-chain items, protocol
mike31 Feb 14, 2018
3434314
Parameter description tweak in params.dat
mike31 Feb 15, 2018
719ef6a
Chunk DB, entities
mike31 Feb 15, 2018
ad7c05d
Fixed, wallet semaphore initialization
mike31 Feb 18, 2018
df58d62
Fixed anyone-can-create
mike31 Feb 19, 2018
624119a
Off-chain data, storage, not debugged
mike31 Feb 19, 2018
2e2f2ac
Skipping writing best block in wallet.dat for walletdbversion=2
mike31 Feb 20, 2018
2b996d2
Off-chain items, protocol
mike31 Feb 20, 2018
9f94bc8
Off-chain items. Publishing using storechunk and rawdata.
mike31 Feb 22, 2018
aefbde4
Fixed change calculation when issuing asset and fee
mike31 Feb 25, 2018
cbde3d4
Publishing off-chain data with raw txs, without storechunk
mike31 Feb 26, 2018
16361d1
Off-chain items, output stream APIs
mike31 Feb 26, 2018
3a24dd6
Off-chain items, multi-chunk items
mike31 Feb 27, 2018
949b6dd
Off-chain items, reporting APIs
mike31 Feb 27, 2018
46c26f4
Off-chain items, gettxoutdata
mike31 Feb 27, 2018
fcb5618
Off-chain data: publish
mike31 Feb 27, 2018
697b55c
minimum0data-fee, not implemented
mike31 Feb 27, 2018
78189ac
Off-chain data, commit on exit
mike31 Feb 27, 2018
9e9c171
minimum-offchain-fee, not implemented
mike31 Feb 28, 2018
0f28ab0
Off-chain items, help messages
mike31 Feb 28, 2018
86d9740
Fixed start/count calcualtion in gettxoutdata
mike31 Feb 28, 2018
340af04
Off-chain items tweaks
mike31 Mar 20, 2018
d8615ac
RPC binary cache
mike31 Mar 20, 2018
3848fb9
Offchain data, salt length and API tweaks
mike31 Mar 22, 2018
7d4973f
Offchain APIs tweaks
mike31 Mar 26, 2018
9a96490
Offchain items, collector db code
mike31 Mar 26, 2018
817596a
Offchain items minor fixes
mike31 Apr 2, 2018
229005e
Relay code, not debugged
mike31 Apr 5, 2018
9fd695e
Offchain messaging code, not debugged
mike31 Apr 11, 2018
b457f64
-addnodeonly runtime parameter
mike31 Apr 11, 2018
ef83057
Offchain messaging, one hop findaddress
mike31 Apr 15, 2018
61eb138
Offhcain messaging, multihop findaddress
mike31 Apr 16, 2018
cc1c04d
Chunkc collection, not debugged
mike31 Apr 18, 2018
e464605
Offchain items - manual fetch from the nearest node
mike31 Apr 23, 2018
c2e29d7
Offchain items, automatic fetching
mike31 Apr 24, 2018
02e96c5
Chunk collection and protocol tweaks, not debugged
mike31 Apr 30, 2018
5ef2b71
Offchain items, automatic fetching
mike31 May 1, 2018
e410114
Offchain items, API tweaks
mike31 May 1, 2018
3e7fc1b
Avoiding connecting to seed if -addnodeonly
mike31 May 1, 2018
77c8b15
Avoiding reading seed.dat if -addnodeonly
mike31 May 2, 2018
4ec87dd
Offchain items logging tweaks
mike31 May 2, 2018
59b197a
Offchain items, logging tweaks
mike31 May 2, 2018
d8c102b
Fixed fetching multiple chunks in one message
mike31 May 2, 2018
fff83fa
Fixed unsubscribe when rows in mempool in wallettxdb
mike31 May 8, 2018
e65527f
Deleting chunks on unsubscribe
mike31 May 8, 2018
5b492c2
Offchain request expiration
mike31 May 10, 2018
6d09e78
Throttling offchain chunk requests
mike31 May 10, 2018
c7d54bd
Fixed offchain request deletion and expiration timestamp
mike31 May 10, 2018
77217f0
Stream restrictions
mike31 May 13, 2018
40a08a0
Stream restrictions, help messages
mike31 May 13, 2018
8b53dfb
Fixed realyed hop count
mike31 May 13, 2018
0e5cfeb
Adding 127.0.0.1 to list of local ips
mike31 May 13, 2018
1d1b048
minimum-offset-fee
mike31 May 14, 2018
f13a1ec
Fixed create stream restrict
mike31 May 14, 2018
483d8fe
Fixed no coins with send permission error message
mike31 May 14, 2018
8f384f5
Fixed setting of autosubscribe value
mike31 May 14, 2018
cc9023f
Fixed non-integer param in getblock
mike31 May 14, 2018
40e6114
Fixed missing help commands
mike31 May 15, 2018
5691590
Fixed wallet encryption for compilation on Ubuntu 18
mike31 May 15, 2018
1b1e46f
Offchain items help messages tweaks
mike31 May 15, 2018
0631ff3
Import from block
mike31 May 15, 2018
7078364
Fixed restrict/open fields in liststreams output
mike31 May 16, 2018
faf77a3
chainbalance in getblockchaininfo
mike31 May 16, 2018
ea9d824
Flushing wallet on startup
mike31 May 21, 2018
c6b7751
Fixed long asset names in raw transactions
mike31 May 21, 2018
aca8974
Keypool tweaks
mike31 May 22, 2018
0ddc6d7
chainrewards
mike31 May 22, 2018
923534a
Better param passing for pause/resume
mike31 May 22, 2018
8e60af8
Chunk retrieval runtimeparams
mike31 May 22, 2018
28f9ff7
Chunk delivery stats
mike31 May 22, 2018
080d7f7
Fixed long entity names bug
mike31 May 23, 2018
09d1fda
Offchain item delivery tweaks
mike31 May 23, 2018
02fe453
Optional chunk immediate flush
mike31 May 23, 2018
ae4cba2
Flushing last source chunk instead of commit
mike31 May 24, 2018
bbed3d9
Flushing chunks on tx commit
mike31 May 24, 2018
1d3298f
Preallocation in chunk db data files
mike31 May 27, 2018
280caa7
Flushing chunks in raw transactions
mike31 May 27, 2018
9ed22e3
Sync options for LevelDB commit
mike31 May 27, 2018
8fe07d5
Default 32 for max-std-op-returns-count
mike31 May 28, 2018
2604b4a
dbwrapper sync-on-commit option
mike31 May 28, 2018
9ffea56
Source chunk DB recovery
mike31 May 28, 2018
19b2021
Counting pending chunks
mike31 May 28, 2018
a95f323
Fixed pending calcualtion in getchunkqueueinfo
mike31 May 28, 2018
35af8a2
Mempool limit for chunk delivery
mike31 May 29, 2018
7c2c8be
Fixed removing/adding queries to delivery mempool
mike31 May 29, 2018
4bc1cc5
Fixed total chunk size calculation
mike31 May 30, 2018
7f09d94
Fixed total chunk size calculation
mike31 May 30, 2018
9667a03
Chunk timeout help
mike31 May 30, 2018
2865f69
Interval between chunk collections
mike31 May 31, 2018
2324160
ignoremissing in getstreamkey/publishsummary
mike31 May 31, 2018
e25eaa3
Fixed 10011/20003 switch
mike31 May 31, 2018
c80282e
Fixed anyone-can-send if stronger anyone-can-*=1
mike31 May 31, 2018
fdacd9d
Fixed long entity name bug on protocol level
mike31 May 31, 2018
af9cdc3
Fixed gettxoutdata bugs
mike31 Jun 3, 2018
37964d5
Changed defaults fox max-std-element-size
mike31 Jun 3, 2018
715e745
Chunk delivery tweaks
mike31 Jun 3, 2018
18cb73a
Change default for -maxsendbuffer
mike31 Jun 3, 2018
c3e745d
Flush file with sync mode for Windows
mike31 Jun 4, 2018
03503e8
getchunktotals, responded field
mike31 Jun 4, 2018
4bc4b89
Fixed unicode items on Windows bug
mike31 Jun 4, 2018
ecb3046
Offchain items tweaks
mike31 Jun 4, 2018
4fa4b6d
Disallowed debug network functionality
mike31 Jun 4, 2018
194d37a
Chunk file size - 128MB
mike31 Jun 4, 2018
b3e7bb7
Parameter upgrade: maximum-chunk-size and maximum-chunk-count
mike31 Jun 4, 2018
12cc667
Available field outside data object and avoiding protocol checks in c…
mike31 Jun 5, 2018
07c3878
Help message for new impot rescan parameters
mike31 Jun 6, 2018
e5118f9
-rpcallowdebug
mike31 Jun 6, 2018
2a46ee6
Moved available field
mike31 Jun 6, 2018
e418ab1
Splitting query records to mitigate latency influence
mike31 Jun 6, 2018
69280ce
Sending not more than one max-size chunk per query
mike31 Jun 7, 2018
7b7baa4
Fixed query/destination limits
mike31 Jun 7, 2018
05fd65a
Fixed number of simlultaneous queries
mike31 Jun 7, 2018
4dd3e53
Fixed query limit calculation
mike31 Jun 7, 2018
fef5f6d
Fixed JSON rounding issue
mike31 Jun 7, 2018
c9a15ce
Fixed available calculation in getstreamkey/publisher summary
mike31 Jun 10, 2018
81d0417
Fixed floating point rounding
mike31 Jun 10, 2018
df55efa
Allowed write permissions for streams with open=true
mike31 Jun 10, 2018
23b2e5e
onchain/offchain instead of onchainonly/offchainonly
mike31 Jun 10, 2018
3434349
Updated versions +10010,10011
mike31 Jun 10, 2018
1be69d8
getchunkqueuetotals/getchunkqueueinfo tweaks
mike31 Jun 10, 2018
f79f0dd
Setting max-std-element-size for old versions
mike31 Jun 10, 2018
3d1c3d9
Fixed stopping source recovery scan
mike31 Jun 11, 2018
d4fb0d7
Fixed source recovery
mike31 Jun 11, 2018
54f33bd
Deleting file on Windows
mike31 Jun 11, 2018
aaffafb
Fixed deleting of binary cache files on Windows
mike31 Jun 11, 2018
5e0f013
listreamitems API tweaks
mike31 Jun 11, 2018
3d0eebe
Fixed number of queries issue
mike31 Jun 12, 2018
d9a0fb1
Merge pull request #61 from MultiChain/2.0-dev
mike31 Jun 13, 2018
b179bd3
Fixed stack smasching on asset ref decoding
mike31 Jun 14, 2018
60780f3
Logging RPC request IDs
mike31 Jun 18, 2018
0257840
Fixed autosubscribe for offchain items
mike31 Jul 9, 2018
47cebfb
Fixed txcount in getwalletinfo
mike31 Jul 16, 2018
a4822f2
Fixed Mac compilation error
mike31 Jul 17, 2018
caa4d73
Fixed Mac compilation issue
mike31 Jul 17, 2018
473edb8
Fixed unicode representation of non-printable characters
mike31 Jul 18, 2018
d93d29b
Boolean rescan for importwallet
mike31 Jul 19, 2018
e9d4a5e
Fixed fdatasync for Mac compilation
mike31 Jul 19, 2018
2a1fc7a
Boolean verbose parameter for getrawtransaction
mike31 Jul 19, 2018
bef04be
Flushing offchain queue on subscribe/unsubscribe
mike31 Jul 26, 2018
7c9fbd0
Random seed, fixing Mac sempahore issue
mike31 Jul 31, 2018
4ec9a04
boost downgrading instructions for MacOS compilation
mike31 Jul 31, 2018
0168cea
Fixed help message for verbose parameter in getrawtransaction
mike31 Jul 31, 2018
a08285b
Avoiding followon scanning when unnecessary
mike31 Aug 2, 2018
61cb440
Fixed watch only flag in getbalance
mike31 Aug 2, 2018
4635a60
liststreamqueryitems preparations
mike31 Aug 2, 2018
32c6bc0
liststreamqueryitems
mike31 Aug 5, 2018
36c76df
liststreamqueryitems help
mike31 Aug 5, 2018
7096905
Multiple txs in liststreamtxitems
mike31 Aug 5, 2018
28f7960
Version 2.0 alpha 4
mike31 Aug 5, 2018
5579db0
maxqueryscanitems runtime parameter
mike31 Aug 6, 2018
4c1fe28
Fixed missing creator list in liststreams
mike31 Aug 6, 2018
d9dbe66
maxqueryscanitems in setruntimeparam
mike31 Aug 6, 2018
ff46bdb
Fixed possible crash when inserting new chunk
mike31 Aug 8, 2018
de34537
Fixed memory leak on our tx count
mike31 Aug 8, 2018
0739e0e
Merge pull request #68 from MultiChain/2.0-dev
mike31 Aug 9, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ Install dependencies
Install brew (follow instructions on brew.sh)
brew install autoconf automake berkeley-db4 libtool boost openssl pkg-config rename

on MacOS High Sierra

brew uninstall boost
brew install [email protected]
brew link [email protected] --force

Prepare for static linking
--------------------------
Apple does not support statically linked binaries as [documented here](https://developer.apple.com/library/content/qa/qa1118/_index.html), however, it is convenient for end-users to launch a binary without having to first install brew, a third-party system designed for developers.
Expand All @@ -113,6 +119,8 @@ The default brew cookbook for berkeley-db and boost builds static libraries, but
In 'def configure_args' change 'shared' to 'no-shared'
brew install openssl --force



Compile MultiChain for Mac (64-bit)
--------------------------

Expand Down
8 changes: 8 additions & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ libbitcoin_server_a_SOURCES = \
protocol/multichaintx.cpp \
protocol/multichainblock.cpp \
custom/custom_server.cpp \
protocol/relay.cpp \
protocol/handshake.cpp \
chain/merkleblock.cpp \
miner/miner.cpp \
Expand All @@ -191,6 +192,9 @@ libbitcoin_server_a_SOURCES = \
json/json_spirit_ubjson.cpp \
rpc/rpcrawdata.cpp \
rpc/rpcutils.cpp \
rpc/rpccache.cpp \
rpc/rpcchunks.cpp \
rpc/rpcdebug.cpp \
rpc/rpchelp.cpp \
rpc/rpcblockchain.cpp \
rpc/rpcmining.cpp \
Expand Down Expand Up @@ -259,6 +263,8 @@ multichain_libbitcoin_multichain_a_SOURCES = \
protocol/multichainscript.cpp \
utils/dbwrapper.cpp \
wallet/wallettxdb.cpp \
wallet/chunkdb.cpp \
wallet/chunkcollector.cpp \
permissions/permission.cpp \
entities/asset.cpp

Expand Down Expand Up @@ -522,6 +528,8 @@ libbitcoinconsensus_la_SOURCES = \
protocol/multichainscript.cpp \
utils/dbwrapper.cpp \
wallet/wallettxdb.cpp \
wallet/chunkdb.cpp \
wallet/chunkcollector.cpp \
permissions/permission.cpp \
entities/asset.cpp \
structs/hash.cpp \
Expand Down
80 changes: 13 additions & 67 deletions src/chainparams/buildgenesis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,11 @@ int mc_MultichainParams::Build(const unsigned char* pubkey, int pubkey_size)
root_stream_name_size=0;
root_stream_name=NULL;

if(mc_gState->m_Features->Streams())
root_stream_name=(unsigned char *)GetParam("rootstreamname",&root_stream_name_size);
if(IsProtocolMultichain() == 0)
{
root_stream_name=(unsigned char *)GetParam("rootstreamname",&root_stream_name_size);
if(IsProtocolMultichain() == 0)
{
root_stream_name_size=0;
}
}
root_stream_name_size=0;
}

while(look_for_genesis)
{
Expand All @@ -141,7 +138,7 @@ int mc_MultichainParams::Build(const unsigned char* pubkey, int pubkey_size)

txNew.vin.resize(1);

if(root_stream_name_size > ( (mc_gState->m_Features->FixedIn10008() != 0) ? 1 : 0 ))
if(root_stream_name_size > 1)
{
txNew.vout.resize(2);
}
Expand Down Expand Up @@ -170,22 +167,15 @@ int mc_MultichainParams::Build(const unsigned char* pubkey, int pubkey_size)

lpScript=new mc_Script;

if(mc_gState->m_Features->Streams())
{
lpScript->SetPermission(MC_PTP_GLOBAL_ALL,0,0xffffffff,timestamp);
}
else
{
lpScript->SetPermission(MC_PTP_ALL,0,0xffffffff,timestamp);
}
lpScript->SetPermission(MC_PTP_GLOBAL_ALL,0,0xffffffff,timestamp);

elem = lpScript->GetData(0,&elem_size);
txNew.vout[0].scriptPubKey << vector<unsigned char>(elem, elem + elem_size) << OP_DROP;

delete lpScript;
}

if(root_stream_name_size > ( (mc_gState->m_Features->FixedIn10008() != 0) ? 1 : 0 ))
if(root_stream_name_size > 1)
{
txNew.vout[1].nValue=0;
lpDetails=new mc_Script;
Expand All @@ -196,12 +186,9 @@ int mc_MultichainParams::Build(const unsigned char* pubkey, int pubkey_size)
lpDetails->SetSpecialParamValue(MC_ENT_SPRM_ANYONE_CAN_WRITE,&b,1);
}

if(mc_gState->m_Features->FixedIn10007())
if( (root_stream_name_size > 1) && (root_stream_name[root_stream_name_size - 1] == 0x00) )
{
if( (root_stream_name_size > 1) && (root_stream_name[root_stream_name_size - 1] == 0x00) )
{
root_stream_name_size--;
}
root_stream_name_size--;
}

lpDetails->SetSpecialParamValue(MC_ENT_SPRM_NAME,root_stream_name,root_stream_name_size);
Expand All @@ -212,44 +199,11 @@ int mc_MultichainParams::Build(const unsigned char* pubkey, int pubkey_size)

lpDetailsScript=new mc_Script;

if(mc_gState->m_Features->OpDropDetailsScripts())
{
lpDetailsScript->SetNewEntityType(MC_ENT_TYPE_STREAM,0,script,bytes);
lpDetailsScript->SetNewEntityType(MC_ENT_TYPE_STREAM,0,script,bytes);

elem = lpDetailsScript->GetData(0,&elem_size);
txNew.vout[1].scriptPubKey=CScript();
txNew.vout[1].scriptPubKey << vector<unsigned char>(elem, elem + elem_size) << OP_DROP << OP_RETURN;
}
else
{
lpDetailsScript->SetNewEntityType(MC_ENT_TYPE_STREAM);

lpDetailsScript->SetGeneralDetails(script,bytes);
txNew.vout[1].scriptPubKey=CScript();

for(int e=0;e<lpDetailsScript->GetNumElements();e++)
{
elem = lpDetailsScript->GetData(e,&elem_size);
if(e == (lpDetailsScript->GetNumElements() - 1) )
{
if(elem_size > 0)
{
txNew.vout[1].scriptPubKey << OP_RETURN << vector<unsigned char>(elem, elem + elem_size);
}
else
{
txNew.vout[1].scriptPubKey << OP_RETURN;
}
}
else
{
if(elem_size > 0)
{
txNew.vout[1].scriptPubKey << vector<unsigned char>(elem, elem + elem_size) << OP_DROP;
}
}
}
}
elem = lpDetailsScript->GetData(0,&elem_size);
txNew.vout[1].scriptPubKey=CScript();
txNew.vout[1].scriptPubKey << vector<unsigned char>(elem, elem + elem_size) << OP_DROP << OP_RETURN;

delete lpDetails;
delete lpDetailsScript;
Expand Down Expand Up @@ -310,14 +264,6 @@ int mc_MultichainParams::Build(const unsigned char* pubkey, int pubkey_size)
{
return err;
}
if(mc_gState->m_Features->Streams() == 0)
{
err=SetParam("genesisopreturnscript","[not set]",9); // Some value required to make parameter set valid, but valid value should start from OP_RETURN
if(err)
{
return err;
}
}

mc_HexToBin(hash,genesis.GetHash().ToString().c_str(),32);
err=SetParam("genesishash",(const char*)hash,32);
Expand Down
75 changes: 14 additions & 61 deletions src/chainparams/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -609,16 +609,12 @@ class CMultiChainParams : public CMainParams {
txNew.vin.resize(1);

root_stream_name_size=0;
root_stream_name=NULL;
if(mc_gState->m_Features->Streams())
root_stream_name=(unsigned char *)mc_gState->m_NetworkParams->GetParam("rootstreamname",&root_stream_name_size);
if(mc_gState->m_NetworkParams->IsProtocolMultichain() == 0)
{
root_stream_name=(unsigned char *)mc_gState->m_NetworkParams->GetParam("rootstreamname",&root_stream_name_size);
if(mc_gState->m_NetworkParams->IsProtocolMultichain() == 0)
{
root_stream_name_size=0;
}
}
if(root_stream_name_size > ( (mc_gState->m_Features->FixedIn10008() != 0) ? 1 : 0 ) )
root_stream_name_size=0;
}
if(root_stream_name_size > 1)
{
txNew.vout.resize(2);
}
Expand Down Expand Up @@ -651,22 +647,15 @@ class CMultiChainParams : public CMainParams {

lpScript=new mc_Script;

if(mc_gState->m_Features->Streams())
{
lpScript->SetPermission(MC_PTP_GLOBAL_ALL,0,0xffffffff,(uint32_t)mc_gState->m_NetworkParams->GetInt64Param("genesistimestamp"));
}
else
{
lpScript->SetPermission(MC_PTP_ALL,0,0xffffffff,(uint32_t)mc_gState->m_NetworkParams->GetInt64Param("genesistimestamp"));
}
lpScript->SetPermission(MC_PTP_GLOBAL_ALL,0,0xffffffff,(uint32_t)mc_gState->m_NetworkParams->GetInt64Param("genesistimestamp"));

elem = lpScript->GetData(0,&elem_size);
txNew.vout[0].scriptPubKey << vector<unsigned char>(elem, elem + elem_size) << OP_DROP;

delete lpScript;
}

if(root_stream_name_size > ( (mc_gState->m_Features->FixedIn10008() != 0) ? 1 : 0 ))
if(root_stream_name_size > 1)
{
txNew.vout[1].nValue=0;
lpDetails=new mc_Script;
Expand All @@ -678,13 +667,10 @@ class CMultiChainParams : public CMainParams {
}


if(mc_gState->m_Features->FixedIn10007())
if( (root_stream_name_size > 1) && (root_stream_name[root_stream_name_size - 1] == 0x00) )
{
if( (root_stream_name_size > 1) && (root_stream_name[root_stream_name_size - 1] == 0x00) )
{
root_stream_name_size--;
}
}
root_stream_name_size--;
}


lpDetails->SetSpecialParamValue(MC_ENT_SPRM_NAME,root_stream_name,root_stream_name_size);
Expand All @@ -695,44 +681,11 @@ class CMultiChainParams : public CMainParams {

lpDetailsScript=new mc_Script;

if(mc_gState->m_Features->OpDropDetailsScripts())
{
lpDetailsScript->SetNewEntityType(MC_ENT_TYPE_STREAM,0,script,bytes);
lpDetailsScript->SetNewEntityType(MC_ENT_TYPE_STREAM,0,script,bytes);

elem = lpDetailsScript->GetData(0,&elem_size);
txNew.vout[1].scriptPubKey=CScript();
txNew.vout[1].scriptPubKey << vector<unsigned char>(elem, elem + elem_size) << OP_DROP << OP_RETURN;
}
else
{
lpDetailsScript->SetNewEntityType(MC_ENT_TYPE_STREAM);

lpDetailsScript->SetGeneralDetails(script,bytes);
txNew.vout[1].scriptPubKey=CScript();

for(int e=0;e<lpDetailsScript->GetNumElements();e++)
{
elem = lpDetailsScript->GetData(e,&elem_size);
if(e == (lpDetailsScript->GetNumElements() - 1) )
{
if(elem_size > 0)
{
txNew.vout[1].scriptPubKey << OP_RETURN << vector<unsigned char>(elem, elem + elem_size);
}
else
{
txNew.vout[1].scriptPubKey << OP_RETURN;
}
}
else
{
if(elem_size > 0)
{
txNew.vout[1].scriptPubKey << vector<unsigned char>(elem, elem + elem_size) << OP_DROP;
}
}
}
}
elem = lpDetailsScript->GetData(0,&elem_size);
txNew.vout[1].scriptPubKey=CScript();
txNew.vout[1].scriptPubKey << vector<unsigned char>(elem, elem + elem_size) << OP_DROP << OP_RETURN;

delete lpDetails;
delete lpDetailsScript;
Expand Down
8 changes: 8 additions & 0 deletions src/chainparams/globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#define GLOBALS_H

mc_State* mc_gState;
unsigned int MIN_OFFCHAIN_FEE = 0; // new
unsigned int MIN_RELAY_TX_FEE = 1000; // new
unsigned int MAX_OP_RETURN_RELAY = 40; // standard.h
unsigned int MAX_BLOCK_SIZE = 1000000; // block.h
Expand All @@ -15,15 +16,20 @@ unsigned int MAX_BLOCK_SIGOPS = 20000;
unsigned int MAX_TX_SIGOPS = 4000; // main.h
int COINBASE_MATURITY = 100; // main.h
unsigned int MAX_SIZE = 0x02000000; // serialize,h
unsigned int OFFCHAIN_MSG_PADDING = 2048; // main.h
int64_t COIN = 100000000; // amount.h
int64_t CENT = 1000000; // amount.h
int64_t MAX_MONEY = 21000000 * COIN; // amount.h
unsigned int MAX_SCRIPT_ELEMENT_SIZE=520; // script.h
int MIN_BLOCKS_BETWEEN_UPGRADES = 100;
int MAX_OP_RETURN_SHOWN=16384;
int MAX_STREAM_QUERY_ITEMS=5000;
int MAX_FORMATTED_DATA_DEPTH=100;
unsigned int MAX_OP_RETURN_OP_DROP_COUNT=100000000;
uint32_t JSON_NO_DOUBLE_FORMATTING=0;
int JSON_DOUBLE_DECIMAL_DIGITS=-1;
int MAX_CHUNK_SIZE = 1048576;
int MAX_CHUNK_COUNT = 1024;

int MCP_MAX_STD_OP_RETURN_COUNT=0;
int64_t MCP_INITIAL_BLOCK_REWARD=0;
Expand All @@ -34,6 +40,8 @@ int MCP_ANYONE_CAN_MINE=0;
int MCP_ANYONE_CAN_CONNECT=0;
int MCP_ANYONE_CAN_SEND=0;
int MCP_ANYONE_CAN_RECEIVE=0;
int MCP_ANYONE_CAN_CREATE=0;
int MCP_ANYONE_CAN_ISSUE=0;
int MCP_ANYONE_CAN_ACTIVATE=0;
int64_t MCP_MINIMUM_PER_OUTPUT=0;
int MCP_ALLOW_ARBITRARY_OUTPUTS=1;
Expand Down
22 changes: 17 additions & 5 deletions src/chainparams/paramlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,16 @@ static const mc_OneMultichainParam MultichainParamArray[] =
"Target time between blocks (transaction confirmation delay), seconds."},
{ "maximumblocksize" , "maximum-block-size" ,
MC_PRM_UINT32 | MC_PRM_USER | MC_PRM_CLONE , -1, 8388608, 5000,1000000000, 0.0, 10001, 0, "-mc-maximumblocksize",
"timingupgrademingap","",
"maximumchunksize","",
"Maximum block size in bytes."},
{ "maximumchunksize" , "maximum-chunk-size" ,
MC_PRM_UINT32 | MC_PRM_USER | MC_PRM_CLONE , -1, 1048576, 256, 16777216, 0.0, 20003, 0, "-mc-maximumchunksize",
"maximumchunkcount","",
"Maximum chunk size for off-chain items in bytes."},
{ "maximumchunkcount" , "maximum-chunk-count" ,
MC_PRM_UINT32 | MC_PRM_USER | MC_PRM_CLONE , -1, 1024, 16, 2048, 0.0, 20003, 0, "-mc-maximumchunkcount",
"timingupgrademingap","",
"Maximum number of chunks in one off-chain item."},
{ "timingupgrademingap" , "timing-upgrade-min-gap" ,
MC_PRM_UINT32 | MC_PRM_USER | MC_PRM_CLONE | MC_PRM_HIDDEN , -1, 100, 1, 31536000, 0.0, 20002, 0, "-mc-timingupgrademingap",
"defaultnetworkport","",
Expand Down Expand Up @@ -127,7 +135,7 @@ static const mc_OneMultichainParam MultichainParamArray[] =
{ "adminconsensuscreate" , "admin-consensus-create" ,
MC_PRM_UINT32 | MC_PRM_USER | MC_PRM_CLONE | MC_PRM_DECIMAL , -1, 0, 0, 1000000, 0.0, 10006, 0, "-mc-adminconsensuscreate",
"adminconsensusissue","",
"<admin-consensus-issue>*<active admins> to change create permissions."},
"<admin-consensus-create>*<active admins> to change create permissions."},
{ "adminconsensusissue" , "admin-consensus-issue" ,
MC_PRM_UINT32 | MC_PRM_USER | MC_PRM_CLONE | MC_PRM_DECIMAL , -1, 0, 0, 1000000, 0.0, 10003, 0, "-mc-adminconsensusissue",
"lockadminminerounds","",
Expand Down Expand Up @@ -176,8 +184,12 @@ static const mc_OneMultichainParam MultichainParamArray[] =
"Minimum native currency per output (anti-dust), in raw units.\nIf set to -1, this is calculated from minimum-relay-fee."},
{ "maximumperoutput" , "maximum-per-output" ,
MC_PRM_INT64 | MC_PRM_USER | MC_PRM_CLONE , -1, 100000000000000, 0,1000000000000000000, 0.0, 10001, 0, "-mc-maximumperoutput",
"minimumrelayfee","",
"minimumoffchainfee","",
"Maximum native currency per output, in raw units."},
{ "minimumoffchainfee" , "minimum-offchain-fee" ,
MC_PRM_INT64 | MC_PRM_USER | MC_PRM_CLONE , -1, 0, 0,1000000000, 0.0, 20003, 0, "-mc-minimumoffchainfee",
"minimumrelayfee","",
"Minimum fee for publishing off-chain data items, per 1000 bytes, in raw units of native currency."},
{ "minimumrelayfee" , "minimum-relay-fee" ,
MC_PRM_INT64 | MC_PRM_USER | MC_PRM_CLONE , -1, 0, 0,1000000000, 0.0, 10001, 0, "-mc-minimumrelayfee",
"nativecurrencymultiple","",
Expand Down Expand Up @@ -214,7 +226,7 @@ static const mc_OneMultichainParam MultichainParamArray[] =
"maxstdopreturnscount","",
"Maximum size of standard transactions, in bytes."},
{ "maxstdopreturnscount" , "max-std-op-returns-count" ,
MC_PRM_UINT32 | MC_PRM_USER | MC_PRM_CLONE , -1, 10, 0, 1024, 0.0, 10006, 0, "-mc-maxstdopreturnscount",
MC_PRM_UINT32 | MC_PRM_USER | MC_PRM_CLONE , -1, 32, 0, 1024, 0.0, 10006, 0, "-mc-maxstdopreturnscount",
"maxstdopreturnsize","",
"Maximum number of OP_RETURN metadata outputs in standard transactions."},
{ "maxstdopreturnsize" , "max-std-op-return-size" ,
Expand All @@ -226,7 +238,7 @@ static const mc_OneMultichainParam MultichainParamArray[] =
"maxstdelementsize","",
"Maximum number of OP_DROPs per output in standard transactions."},
{ "maxstdelementsize" , "max-std-element-size" ,
MC_PRM_INT64 | MC_PRM_USER | MC_PRM_CLONE , -1, 8192, 128, 32768, 0.0, 10003, 0, "-mc-maxscriptelementsize",
MC_PRM_INT64 | MC_PRM_USER | MC_PRM_CLONE , -1, 40000, 128, 80000, 0.0, 10003, 0, "-mc-maxscriptelementsize",
"maxstdopdropsize","",
"Maximum size of data elements in standard transactions, in bytes."},

Expand Down
Loading