Skip to content

Commit

Permalink
Merge Changes from Master
Browse files Browse the repository at this point in the history
  • Loading branch information
VidereLicet committed Oct 8, 2016
1 parent 1678f66 commit 29b1078
Show file tree
Hide file tree
Showing 9 changed files with 113 additions and 16 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
*.exe
*.Debug
*.Release
*.kate-swp
*.kate-swp
*.db
4 changes: 3 additions & 1 deletion src/LLP/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ namespace LLP


/** Handle any DDOS Filters. **/
if(fDDOS)
boost::system::error_code ec;
std::string ADDRESS = CONNECTIONS[nIndex]->GetIPAddress();
if(fDDOS && ADDRESS != "127.0.0.1")
{
/** Ban a node if it has too many Requests per Second. **/
if(CONNECTIONS[nIndex]->DDOS->rSCORE.Score() > DDOS_rSCORE || CONNECTIONS[nIndex]->DDOS->cSCORE.Score() > DDOS_cSCORE)
Expand Down
6 changes: 6 additions & 0 deletions src/LLP/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,12 @@ namespace LLP

CONNECTED = false;
}

std::string GetIPAddress()
{
boost::system::error_code ec;
return SOCKET->remote_endpoint(ec).address().to_string();
}


private:
Expand Down
15 changes: 14 additions & 1 deletion src/core/mining.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,20 @@ namespace LLP

/** If There are no Active nodes, or it is Initial Block Download:
Send a failed response to the miners. **/
if(Net::vNodes.size() == 0 || Core::IsInitialBlockDownload() || pwalletMain->IsLocked()) { printf("%%%%%%%%%% Mining LLP: Rejected Request...\n"); return false; }
if(Net::vNodes.size() == 0 )
{
printf("%%%%%%%%%% Mining LLP: Rejected Request...No Connections\n"); return false;
}

if(Core::IsInitialBlockDownload() )
{
printf("%%%%%%%%%% Mining LLP: Rejected Request...Downloadning BLockchain\n"); return false;
}

if( pwalletMain->IsLocked())
{
printf("%%%%%%%%%% Mining LLP: Rejected Request...Wallet Locked\n"); return false;
}


/** Set the Mining Channel this Connection will Serve Blocks for. **/
Expand Down
17 changes: 16 additions & 1 deletion src/core/unifiedtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,22 @@ const char* DNS_SeedNodes[] =
"node10.nexusearth.com",
"node11.nexusearth.com",
"node12.nexusearth.com",
"node13.nexusearth.com"
"node13.nexusearth.com",
"node1.mercuryminer.com",
"node2.mercuryminer.com",
"node3.mercuryminer.com",
"node4.mercuryminer.com",
"node5.mercuryminer.com",
"node6.mercuryminer.com",
"node7.mercuryminer.com",
"node8.mercuryminer.com",
"node9.mercuryminer.com",
"node10.mercuryminer.com",
"node11.mercuryminer.com",
"node12.mercuryminer.com",
"node13.mercuryminer.com",
"node1.nexusminingpool.com",
"node2.nexusminingpool.com"
};

/** Declarations for the DNS Seed Nodes. **/
Expand Down
8 changes: 3 additions & 5 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,15 +341,16 @@ bool AppInit2(int argc, char* argv[])
InitMessage(_("Initializing LLD Keychains..."));
LLD::RegisterKeychain("blkindex", "blkindex");

InitMessage(_("Initializing Unified Time..."));
printf("Initializing Unified Time...\n");
InitMessage(_("Initializing Unified Time..."));
printf("Initializing Unified Time...\n");
InitializeUnifiedTime();


/** Wait for Unified Time if First Start. **/
while(!fTimeUnified)
Sleep(10);

/** Start sending Unified Samples. **/
if(GetBoolArg("-unified", false)) {
InitMessage(_("Initializing Core LLP..."));
printf("Initializing Core LLP...\n");
Expand Down Expand Up @@ -610,9 +611,6 @@ bool AppInit2(int argc, char* argv[])
}
}

/** Add in the Allowed IP's for Mining LLP. **/


//
// Start the node
//
Expand Down
11 changes: 8 additions & 3 deletions src/net/rpcserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,13 @@ namespace Net
obj.push_back(Pair("balance", ValueFromAmount(pwalletMain->GetBalance())));
obj.push_back(Pair("newmint", ValueFromAmount(pwalletMain->GetNewMint())));
obj.push_back(Pair("stake", ValueFromAmount(pwalletMain->GetStake())));

double dPercent = ((double)Core::dTrustWeight + (double)Core::dBlockWeight) / 37.5;
obj.push_back(Pair("interestweight", (double)Core::dInterestRate * 100.0));
obj.push_back(Pair("stakeweight", dPercent * 100.0));
obj.push_back(Pair("trustweight", (double)Core::dTrustWeight * 100.0 / 17.5));
obj.push_back(Pair("blockweight", (double)Core::dBlockWeight * 100.0 / 20.0));

obj.push_back(Pair("blocks", (int)Core::nBestHeight));
obj.push_back(Pair("timestamp", (int)GetUnifiedTimestamp()));

Expand Down Expand Up @@ -415,9 +422,7 @@ namespace Net
obj.push_back(Pair("hashReserve", ValueFromAmount(pindexGPU->nReleasedReserve[0])));
obj.push_back(Pair("primeValue", ValueFromAmount(Core::GetCoinbaseReward(Core::pindexBest, 1, 0))));
obj.push_back(Pair("hashValue", ValueFromAmount(Core::GetCoinbaseReward(Core::pindexBest, 2, 0))));
obj.push_back(Pair("pooledtx", (uint64_t)Core::mempool.size()));


obj.push_back(Pair("pooledtx", (uint64_t)Core::mempool.size()));
return obj;
}

Expand Down
2 changes: 1 addition & 1 deletion src/qt/dialogs/askpassphrasedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ void AskPassphraseDialog::accept()
break;
}
QMessageBox::StandardButton retval = QMessageBox::question(this, tr("Confirm wallet encryption"),
tr("WARNING: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR NexusS</b>!\nAre you sure you wish to encrypt your wallet?"),
tr("WARNING: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR NXS</b>!\nAre you sure you wish to encrypt your wallet?"),
QMessageBox::Yes|QMessageBox::Cancel,
QMessageBox::Cancel);
if(retval == QMessageBox::Yes)
Expand Down
63 changes: 60 additions & 3 deletions src/wallet/db.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -675,13 +675,70 @@ namespace Wallet
/** Test Case to Write to LLD Indexing Database. **/
Core::CDiskBlockIndex diskIndex(pindex);
indexdb.WriteBlockIndex(diskIndex);
}

pindex = pindex->pnext;

/** Exit the Loop on the Best Block. **/
if(!pindex)
/** Add the Pending Checkpoint into the Blockchain. **/
if(!pindex->pprev || Core::HardenCheckpoint(pindex, true))
pindex->PendingCheckpoint = make_pair(pindex->nHeight, pindex->GetBlockHash());
else
pindex->PendingCheckpoint = pindex->pprev->PendingCheckpoint;

/** Exit the Loop on the Best Block. **/
if(pindex->GetBlockHash() == Core::hashBestChain)
{
printf("LoadBlockIndex(): hashBestChain=%s height=%d trust=%s\n", Core::hashBestChain.ToString().substr(0,20).c_str(), Core::nBestHeight, Core::bnBestChainTrust.ToString().c_str());
break;
}


pindex = pindex->pnext;
}

// Load bnBestInvalidTrust, OK if it doesn't exist
ReadBestInvalidTrust(Core::bnBestInvalidTrust);



/** Verify the Blocks in the Best Chain To Last Checkpoint. **/
int nCheckLevel = GetArg("-checklevel", 1);

int nCheckDepth = GetArg( "-checkblocks", 100);
//if (nCheckDepth == 0)
// nCheckDepth = 1000000000;

if (nCheckDepth > Core::nBestHeight)
nCheckDepth = Core::nBestHeight;
printf("Verifying last %i blocks at level %i\n", nCheckDepth, nCheckLevel);
Core::CBlockIndex* pindexFork = NULL;

/* Allow Forking out an old chain. */
unsigned int nFork = GetArg("-forkblocks", 0);
if(nFork > 0 && Core::pindexBest)
{
pindexFork = Core::pindexBest;
for(int nIndex = 0; nIndex < nFork; nIndex++)
{
if(!pindexFork->pprev)
break;

pindexFork = pindexFork->pprev;
}
}


map<pair<unsigned int, unsigned int>, Core::CBlockIndex*> mapBlockPos;
for (Core::CBlockIndex* pindex = Core::pindexBest; pindex && pindex->pprev && nCheckDepth > 0; pindex = pindex->pprev)
{
if (pindex->nHeight < Core::nBestHeight - nCheckDepth)
break;

pindex = pindex->pnext;

/** Exit the Loop on the Best Block. **/
if(!pindex)
break;
}
}


Expand Down

0 comments on commit 29b1078

Please sign in to comment.