Skip to content

Commit

Permalink
Merge pull request #2 from Lindacoin/masternode-1.0.1.1
Browse files Browse the repository at this point in the history
fixes for masternodes
  • Loading branch information
Lindacoin authored Jul 28, 2017
2 parents c6c37a6 + 36ea430 commit f914abe
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 22 deletions.
7 changes: 2 additions & 5 deletions src/activemasternode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ vector<COutput> CActiveMasternode::SelectCoinsMasternode()
// Filter
BOOST_FOREACH(const COutput& out, vCoins)
{
if(out.tx->vout[out.i].nValue == 112*COIN) { //exactly
if(out.tx->vout[out.i].nValue == 30000000*COIN) { //exactly
filteredCoins.push_back(out);
}
}
Expand All @@ -384,13 +384,11 @@ vector<COutput> CActiveMasternode::SelectCoinsMasternode()
bool CActiveMasternode::SelectCoinsMasternode(CTxIn& vin, int64& nValueIn, CScript& pubScript, std::string strTxHash, std::string strOutputIndex)
{
CWalletTx ctx;
// Convert configuration strings
uint256 txHash;
int outputIndex;
txHash.SetHex(strTxHash);
std::istringstream(strOutputIndex) >> outputIndex;
if(pwalletMain->GetTransaction(txHash, ctx)) {
if(ctx.vout[outputIndex].nValue == 1000*COIN) { //exactly
vin = CTxIn(ctx.GetHash(), outputIndex);
Expand All @@ -399,7 +397,6 @@ bool CActiveMasternode::SelectCoinsMasternode(CTxIn& vin, int64& nValueIn, CScri
return true;
}
}
return false;
}
*/
Expand All @@ -418,4 +415,4 @@ bool CActiveMasternode::EnableHotColdMasterNode(CTxIn& newVin, CService& newServ
LogPrintf("CActiveMasternode::EnableHotColdMasterNode() - Enabled! You may shut down the cold daemon.\n");

return true;
}
}
5 changes: 3 additions & 2 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,14 @@ class CMainParams : public CChainParams {
// The message start string is designed to be unlikely to occur in normal data.
// The characters are rarely used upper ASCII, not valid as UTF-8, and produce
// a large 4-byte int at any alignment.
//add 1 to the start message for Linda 1.0.1 so we dont talk to old wallets, and change the default port's
pchMessageStart[0] = 0x9c;
pchMessageStart[1] = 0xd3;
pchMessageStart[2] = 0x17;
pchMessageStart[3] = 0x01;
vAlertPubKey = ParseHex("04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f");
nDefaultPort = 93820;
nRPCPort = 93821;
nDefaultPort = 33820;
nRPCPort = 33821;
bnProofOfWorkLimit = CBigNum(~uint256(0) >> 20);

// Build the genesis block. Note that the output of the genesis coinbase cannot
Expand Down
4 changes: 2 additions & 2 deletions src/clientversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
// These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it
#define CLIENT_VERSION_MAJOR 1
#define CLIENT_VERSION_MINOR 0
#define CLIENT_VERSION_REVISION 0
#define CLIENT_VERSION_BUILD 0
#define CLIENT_VERSION_REVISION 1
#define CLIENT_VERSION_BUILD 1

// Set to true for release, false for prerelease or test build
#define CLIENT_VERSION_IS_RELEASE true
Expand Down
6 changes: 2 additions & 4 deletions src/darksend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,6 @@ void CDarkSendPool::ChargeRandomFees(){

/*
Collateral Fee Charges:
Being that DarkSend has "no fees" we need to have some kind of cost associated
with using it to stop abuse. Otherwise it could serve as an attack vector and
allow endless transaction that would bloat Linda and make it unusable. To
Expand Down Expand Up @@ -1783,7 +1782,6 @@ bool CDarkSendPool::IsCompatibleWithEntries(std::vector<CTxOut> vout)
/*
BOOST_FOREACH(CTxOut o1, vout)
LogPrintf(" vout 1 - %s\n", o1.ToString().c_str());
BOOST_FOREACH(CTxOut o2, v.vout)
LogPrintf(" vout 2 - %s\n", o2.ToString().c_str());
*/
Expand Down Expand Up @@ -1985,7 +1983,7 @@ bool CDarkSendSigner::IsVinAssociatedWithPubkey(CTxIn& vin, CPubKey& pubkey){
//if(GetTransaction(vin.prevout.hash, txVin, hash, true)){
if(GetTransaction(vin.prevout.hash, txVin, hash)){
BOOST_FOREACH(CTxOut out, txVin.vout){
if(out.nValue == 112*COIN){
if(out.nValue == 30000000*COIN){
if(out.scriptPubKey == payee2) return true;
}
}
Expand Down Expand Up @@ -2203,4 +2201,4 @@ void ThreadCheckDarkSendPool()
}
}
}
}
}
3 changes: 2 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -781,8 +781,9 @@ bool AcceptableInputs(CTxMemPool& pool, const CTransaction &txo, bool fLimitFree
return tx.DoS(100, error("AcceptableInputs : coinstake as individual tx"));

// Rather not work on nonstandard transactions (unless -testnet)
//alot of Linda transactions seem non standard, its a bug so we have to accept these, the transactions have still been checekd to be valid and unspent.
string reason;
if (!TestNet() && !IsStandardTx(tx, reason))
if (false && !TestNet() && !IsStandardTx(tx, reason))
return error("AcceptableInputs : nonstandard transaction: %s",
reason);

Expand Down
4 changes: 2 additions & 2 deletions src/masternode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ void ProcessMessageMasternode(CNode* pfrom, std::string& strCommand, CDataStream

CValidationState state;
CTransaction tx = CTransaction();
CTxOut vout = CTxOut(111*COIN, darkSendPool.collateralPubKey);
CTxOut vout = CTxOut(29999999*COIN, darkSendPool.collateralPubKey);
tx.vin.push_back(vin);
tx.vout.push_back(vout);
//if(AcceptableInputs(mempool, state, tx)){
Expand Down Expand Up @@ -594,7 +594,7 @@ void CMasterNode::Check()
if(!unitTest){
CValidationState state;
CTransaction tx = CTransaction();
CTxOut vout = CTxOut(111*COIN, darkSendPool.collateralPubKey);
CTxOut vout = CTxOut(29999999*COIN, darkSendPool.collateralPubKey);
tx.vin.push_back(vin);
tx.vout.push_back(vout);

Expand Down
6 changes: 3 additions & 3 deletions src/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1153,13 +1153,13 @@ void createConf() //Automatic BitcoinDark.conf generation

ofstream pConf;
pConf.open(GetConfigFile().generic_string().c_str());
const char* nodes = "\nrpcport=93821" //List of known nodes, to be periodically updated
const char* nodes = "\nrpcport=33821" //List of known nodes, to be periodically updated
"\nrpcallowip=127.0.0.1"
"\ndaemon=1"
"\nserver=1"
"\nlistenonion=0"
"\naddnode=185.82.200.183"
"\naddnode=185.183.98.138";
"\naddnode=104.238.159.161"
"\naddnode=45.32.77.164";

pConf << std::string("rpcuser=")
+ randomStrGen(5)
Expand Down
6 changes: 3 additions & 3 deletions src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ static const int DATABASE_VERSION = 70509;
// network protocol versioning
//

static const int PROTOCOL_VERSION = 60020;
static const int PROTOCOL_VERSION = 60032;

// intial proto version, to be increased after version/verack negotiation
static const int INIT_PROTO_VERSION = 209;
Expand All @@ -40,11 +40,11 @@ static const int MIN_PEER_PROTO_VERSION = 60020;

static const int MIN_INSTANTX_PROTO_VERSION = 60020;

static const int MIN_MN_PROTO_VERSION = 60020;
static const int MIN_MN_PROTO_VERSION = 60030;

// nTime field added to CAddress, starting with this version;
// if possible, avoid requesting addresses nodes older than this
static const int CADDR_TIME_VERSION = 31402;
static const int CADDR_TIME_VERSION = 60030;

// only request blocks from nodes outside this range of versions
static const int NOBLKS_VERSION_START = 0;
Expand Down

0 comments on commit f914abe

Please sign in to comment.