Cleanup and remove dead code
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
#include "hush_defs.h"
|
||||
#include "CCinclude.h"
|
||||
|
||||
int32_t komodo_priceget(int64_t *buf64,int32_t ind,int32_t height,int32_t numblocks);
|
||||
int32_t hush_priceget(int64_t *buf64,int32_t ind,int32_t height,int32_t numblocks);
|
||||
extern void GetHushEarlytxidScriptPub();
|
||||
extern CScript HUSH_EARLYTXID_SCRIPTPUB;
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ However, this is the CC contract basics chapter, so let us ignore mempool issues
|
||||
|
||||
That means to just follow a known working template and only changing the things where the existing templates are not sufficient, ie. the core differentiator of your CC contract.
|
||||
|
||||
In the ~/komodo/src/cc/eval.h file all the eval codes are defined, currently:
|
||||
In the hush3/src/cc/eval.h file all the eval codes are defined, currently:
|
||||
|
||||
#define FOREACH_EVAL(EVAL) \
|
||||
EVAL(EVAL_IMPORTPAYOUT, 0xe1) \
|
||||
@@ -201,7 +201,7 @@ You do need to be careful not to cause a deadlock as the CC validation code is c
|
||||
Chapter 6 - faucet example
|
||||
Finally, we are ready for the first actual example of a CC contract. The faucet. This is a very simple contract and it ran into some interesting bugs in the first incarnation.
|
||||
|
||||
The code in ~/komodo/src/cc/faucet.cpp is the ultimate documentation for it with all the details, so I will just address the conceptual issues here.
|
||||
The code in hush3/src/cc/faucet.cpp is the ultimate documentation for it with all the details, so I will just address the conceptual issues here.
|
||||
|
||||
The idea is that people send funds to the faucet by locking it in faucet's global CC address and anybody is allowed to create a faucetget transaction that spends it.
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ std::string MYCCLIBNAME = (char *)"sudoku";
|
||||
#endif
|
||||
|
||||
#ifndef BUILD_GAMESCC
|
||||
void komodo_netevent(std::vector<uint8_t> payload) {}
|
||||
void hush_netevent(std::vector<uint8_t> payload) {}
|
||||
#endif
|
||||
|
||||
extern std::string MYCCLIBNAME;
|
||||
|
||||
@@ -479,7 +479,7 @@ int32_t games_event(uint32_t timestamp,uint256 gametxid,int32_t eventid,std::vec
|
||||
{
|
||||
GetOpReturnData(games_eventopret(timestamp,mypk,sig,payload),vopret);
|
||||
games_payloadrecv(mypk,timestamp,payload);
|
||||
komodo_sendmessage(4,8,"events",vopret);
|
||||
hush_sendmessage(4,8,"events",vopret);
|
||||
return(0);
|
||||
}
|
||||
fprintf(stderr,"games_eventsign error\n");
|
||||
@@ -539,7 +539,7 @@ UniValue games_events(uint64_t txfee,struct CCcontract_info *cp,cJSON *params)
|
||||
return(result);
|
||||
}
|
||||
|
||||
void komodo_netevent(std::vector<uint8_t> message)
|
||||
void hush_netevent(std::vector<uint8_t> message)
|
||||
{
|
||||
int32_t i,retval,lag,lagerr=0; uint32_t timestamp,now; CPubKey pk; std::vector<uint8_t> sig,payload; char str[67];
|
||||
if ( games_eventdecode(timestamp,pk,sig,payload,message) == 'E' )
|
||||
@@ -560,7 +560,7 @@ void komodo_netevent(std::vector<uint8_t> message)
|
||||
if ( (rand() % 10) == 0 )
|
||||
{
|
||||
//fprintf(stderr,"relay message.[%d]\n",(int32_t)message.size());
|
||||
komodo_sendmessage(2,2,"events",message);
|
||||
hush_sendmessage(2,2,"events",message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user