Skip to content
This repository was archived by the owner on Apr 2, 2025. It is now read-only.

Commit 4981072

Browse files
authored
Merge pull request jl777#501 from jl777/dev
MSHARK and assetchains with hash as name
2 parents 5aacfee + 67030c8 commit 4981072

33 files changed

Lines changed: 112 additions & 36 deletions

src/assetchains

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ komodo_asset BET 999999
3636
komodo_asset CRYPTO 999999
3737
komodo_asset HODL 9999999
3838
komodo_asset SHARK 1401
39+
komodo_asset MSHARK 1400000
3940
komodo_asset BOTS 999999
4041
komodo_asset MGW 999999
4142
#komodo_asset MVP 1000000

src/assetchains.old

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ echo $pubkey
1313
./komodod -pubkey=$pubkey -ac_name=CRYPTO -ac_supply=999999 -addnode=78.47.196.146 $1 &
1414
./komodod -pubkey=$pubkey -ac_name=HODL -ac_supply=9999999 -addnode=78.47.196.146 $1 &
1515
./komodod -pubkey=$pubkey -ac_name=SHARK -ac_supply=1401 -addnode=78.47.196.146 $1 &
16+
./komodod -pubkey=$pubkey -ac_name=MSHARK -ac_supply=1400000 -addnode=78.47.196.146 $1 &
1617
./komodod -pubkey=$pubkey -ac_name=BOTS -ac_supply=999999 -addnode=78.47.196.146 $1 &
1718
./komodod -pubkey=$pubkey -ac_name=MGW -ac_supply=999999 -addnode=78.47.196.146 $1 &
1819
#./komodod -pubkey=$pubkey -ac_name=MVP -ac_supply=1000000 -addnode=78.47.196.146 $1 &

src/bitcoind.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@
4242
*/
4343

4444
static bool fDaemon;
45-
extern char ASSETCHAINS_SYMBOL[16];
45+
#define KOMODO_ASSETCHAIN_MAXLEN 65
46+
extern char ASSETCHAINS_SYMBOL[KOMODO_ASSETCHAIN_MAXLEN];
4647
void komodo_passport_iteration();
4748

4849
void WaitForShutdown(boost::thread_group* threadGroup)

src/chainparams.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ using namespace std;
3030
* + Contains no strange transactions
3131
*/
3232
void *chainparams_commandline(void *ptr);
33-
extern char ASSETCHAINS_SYMBOL[16];
33+
#include "komodo_defs.h"
34+
35+
extern char ASSETCHAINS_SYMBOL[KOMODO_ASSETCHAIN_MAXLEN];
3436
extern uint16_t ASSETCHAINS_PORT;
3537
extern uint32_t ASSETCHAIN_INIT;
3638
extern uint32_t ASSETCHAINS_MAGIC;

src/coins.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "random.h"
99
#include "version.h"
1010
#include "policy/fees.h"
11+
#include "komodo_defs.h"
1112

1213
#include <assert.h>
1314

@@ -387,7 +388,7 @@ const CScript &CCoinsViewCache::GetSpendFor(const CTxIn& input) const
387388

388389
//uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uint32_t tiptime);
389390
uint64_t komodo_accrued_interest(int32_t *txheightp,uint32_t *locktimep,uint256 hash,int32_t n,int32_t checkheight,uint64_t checkvalue);
390-
extern char ASSETCHAINS_SYMBOL[16];
391+
extern char ASSETCHAINS_SYMBOL[KOMODO_ASSETCHAIN_MAXLEN];
391392

392393
CAmount CCoinsViewCache::GetValueIn(int32_t nHeight,int64_t *interestp,const CTransaction& tx,uint32_t tiptime) const
393394
{

src/dpowassets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dp
1414
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"CRYPTO\",\"pubkey\":\"$pubkey\"}"
1515
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"HODL\",\"pubkey\":\"$pubkey\"}"
1616
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"SHARK\",\"pubkey\":\"$pubkey\"}"
17+
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"MSHARK\",\"pubkey\":\"$pubkey\"}"
1718
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"BOTS\",\"pubkey\":\"$pubkey\"}"
1819
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"MGW\",\"pubkey\":\"$pubkey\"}"
1920
#curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"MVP\",\"pubkey\":\"$pubkey\"}"

src/fiat-cli

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ echo bet; fiat/bet $1 $2 $3 $4
4141
echo crypto; fiat/crypto $1 $2 $3 $4
4242
echo hodl; fiat/hodl $1 $2 $3 $4
4343
echo shark; fiat/shark $1 $2 $3 $4
44+
echo mshark; fiat/mshark $1 $2 $3 $4
4445
echo bots; fiat/bots $1 $2 $3 $4
4546
echo mgw; fiat/mgw $1 $2 $3 $4
4647
#echo mvp; fiat/mvp $1 $2 $3 $4

src/fiat/mshark

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/bash
2+
./komodo-cli -ac_name=MSHARK $1 $2 $3 $4 $5 $6

src/komodo-tx.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ using namespace std;
2727
#include "arith_uint256.h"
2828
#include "komodo_structs.h"
2929
#include "komodo_globals.h"
30+
#include "komodo_defs.h"
3031

3132
#include "komodo_interest.h"
3233

src/komodo.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
#ifndef H_KOMODO_H
1717
#define H_KOMODO_H
18+
#include "komodo_defs.h"
1819

1920
#ifdef _WIN32
2021
#define printf(...)
@@ -56,14 +57,14 @@ int32_t komodo_parsestatefile(struct komodo_state *sp,FILE *fp,char *symbol,char
5657

5758
void komodo_currentheight_set(int32_t height)
5859
{
59-
char symbol[16],dest[16]; struct komodo_state *sp;
60+
char symbol[KOMODO_ASSETCHAIN_MAXLEN],dest[KOMODO_ASSETCHAIN_MAXLEN]; struct komodo_state *sp;
6061
if ( (sp= komodo_stateptr(symbol,dest)) != 0 )
6162
sp->CURRENT_HEIGHT = height;
6263
}
6364

6465
int32_t komodo_currentheight()
6566
{
66-
char symbol[16],dest[16]; struct komodo_state *sp;
67+
char symbol[KOMODO_ASSETCHAIN_MAXLEN],dest[KOMODO_ASSETCHAIN_MAXLEN]; struct komodo_state *sp;
6768
if ( (sp= komodo_stateptr(symbol,dest)) != 0 )
6869
return(sp->CURRENT_HEIGHT);
6970
else return(0);
@@ -328,7 +329,7 @@ int32_t komodo_parsestatefiledata(struct komodo_state *sp,uint8_t *filedata,long
328329
void komodo_stateupdate(int32_t height,uint8_t notarypubs[][33],uint8_t numnotaries,uint8_t notaryid,uint256 txhash,uint64_t voutmask,uint8_t numvouts,uint32_t *pvals,uint8_t numpvals,int32_t KMDheight,uint32_t KMDtimestamp,uint64_t opretvalue,uint8_t *opretbuf,uint16_t opretlen,uint16_t vout)
329330
{
330331
static FILE *fp; static int32_t errs,didinit;
331-
struct komodo_state *sp; char fname[512],symbol[16],dest[16]; int32_t retval,ht,func; uint8_t num,pubkeys[64][33];
332+
struct komodo_state *sp; char fname[512],symbol[KOMODO_ASSETCHAIN_MAXLEN],dest[KOMODO_ASSETCHAIN_MAXLEN]; int32_t retval,ht,func; uint8_t num,pubkeys[64][33];
332333
if ( didinit == 0 )
333334
{
334335
portable_mutex_init(&KOMODO_KV_mutex);
@@ -475,7 +476,7 @@ void komodo_stateupdate(int32_t height,uint8_t notarypubs[][33],uint8_t numnotar
475476
int32_t komodo_voutupdate(int32_t *isratificationp,int32_t notaryid,uint8_t *scriptbuf,int32_t scriptlen,int32_t height,uint256 txhash,int32_t i,int32_t j,uint64_t *voutmaskp,int32_t *specialtxp,int32_t *notarizedheightp,uint64_t value,int32_t notarized,uint64_t signedmask)
476477
{
477478
static uint256 zero; static FILE *signedfp;
478-
int32_t opretlen,nid,k,len = 0; uint256 kmdtxid,desttxid; uint8_t crypto777[33]; struct komodo_state *sp; char symbol[16],dest[16];
479+
int32_t opretlen,nid,k,len = 0; uint256 kmdtxid,desttxid; uint8_t crypto777[33]; struct komodo_state *sp; char symbol[KOMODO_ASSETCHAIN_MAXLEN],dest[KOMODO_ASSETCHAIN_MAXLEN];
479480
if ( (sp= komodo_stateptr(symbol,dest)) == 0 )
480481
return(-1);
481482
if ( scriptlen == 35 && scriptbuf[0] == 33 && scriptbuf[34] == 0xac )
@@ -633,7 +634,7 @@ int32_t komodo_notarycmp(uint8_t *scriptPubKey,int32_t scriptlen,uint8_t pubkeys
633634
void komodo_connectblock(CBlockIndex *pindex,CBlock& block)
634635
{
635636
static int32_t hwmheight;
636-
uint64_t signedmask,voutmask; char symbol[16],dest[16]; struct komodo_state *sp;
637+
uint64_t signedmask,voutmask; char symbol[KOMODO_ASSETCHAIN_MAXLEN],dest[KOMODO_ASSETCHAIN_MAXLEN]; struct komodo_state *sp;
637638
uint8_t scriptbuf[4096],pubkeys[64][33],rmd160[20],scriptPubKey[35]; uint256 kmdtxid,zero,btctxid,txhash;
638639
int32_t i,j,k,numnotaries,notarized,scriptlen,isratification,nid,numvalid,specialtx,notarizedheight,notaryid,len,numvouts,numvins,height,txn_count;
639640
memset(&zero,0,sizeof(zero));

0 commit comments

Comments
 (0)