From 6b4ad4b6581cc0680111e8ea3c4c196bf762d8c7 Mon Sep 17 00:00:00 2001 From: Whit Jack Date: Wed, 6 May 2015 20:17:18 -0700 Subject: [PATCH] Add stuff --- CHANGELOG.md | 83 +++++++++++++++++++++++++++++++++++++++++++++++++ opalcoin-qt.pro | 2 +- src/main.cpp | 20 ++++++++++-- src/main.h | 1 + 4 files changed, 103 insertions(+), 3 deletions(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..33ec0e7b --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,83 @@ +# Change Log + +## [fund](https://github.com/opalcoin/opalcoin/tree/fund) (2015-03-24) + +[Full Changelog](https://github.com/opalcoin/opalcoin/compare/v1.3.2...fund) + +**Closed issues:** + +- BlackCoin residues [\#25](https://github.com/OpalCoin/OpalCoin/issues/25) + +**Merged pull requests:** + +- Add alias system [\#24](https://github.com/OpalCoin/OpalCoin/pull/24) ([whitj00](https://github.com/whitj00)) + +- Add alias system [\#23](https://github.com/OpalCoin/OpalCoin/pull/23) ([whitj00](https://github.com/whitj00)) + +## [v1.3.2](https://github.com/opalcoin/opalcoin/tree/v1.3.2) (2015-02-09) + +[Full Changelog](https://github.com/opalcoin/opalcoin/compare/v1.3.1...v1.3.2) + +**Merged pull requests:** + +- Multisigfix [\#22](https://github.com/OpalCoin/OpalCoin/pull/22) ([whitj00](https://github.com/whitj00)) + +- qt5 [\#21](https://github.com/OpalCoin/OpalCoin/pull/21) ([whitj00](https://github.com/whitj00)) + +- v1.3.1 [\#20](https://github.com/OpalCoin/OpalCoin/pull/20) ([whitj00](https://github.com/whitj00)) + +## [v1.3.1](https://github.com/opalcoin/opalcoin/tree/v1.3.1) (2015-01-03) + +[Full Changelog](https://github.com/opalcoin/opalcoin/compare/v1.1...v1.3.1) + +**Closed issues:** + +- Can't find db\_cxx.h [\#17](https://github.com/OpalCoin/OpalCoin/issues/17) + +**Merged pull requests:** + +- v1.3.1 [\#19](https://github.com/OpalCoin/OpalCoin/pull/19) ([whitj00](https://github.com/whitj00)) + +- Update README [\#16](https://github.com/OpalCoin/OpalCoin/pull/16) ([Danz0r77](https://github.com/Danz0r77)) + +- Files [\#18](https://github.com/OpalCoin/OpalCoin/pull/18) ([SparkMasterTape](https://github.com/SparkMasterTape)) + +## [v1.1](https://github.com/opalcoin/opalcoin/tree/v1.1) (2014-10-11) + +**Closed issues:** + +- Dock Icon is still Oynxcoin Branding [\#2](https://github.com/OpalCoin/OpalCoin/issues/2) + +**Merged pull requests:** + +- Merge Stealth into Master [\#15](https://github.com/OpalCoin/OpalCoin/pull/15) ([whitj00](https://github.com/whitj00)) + +- Merge master into stealth [\#14](https://github.com/OpalCoin/OpalCoin/pull/14) ([whitj00](https://github.com/whitj00)) + +- Stealth [\#13](https://github.com/OpalCoin/OpalCoin/pull/13) ([whitj00](https://github.com/whitj00)) + +- Update .travis.yml [\#12](https://github.com/OpalCoin/OpalCoin/pull/12) ([whitj00](https://github.com/whitj00)) + +- Change Icon and Name [\#11](https://github.com/OpalCoin/OpalCoin/pull/11) ([whitj00](https://github.com/whitj00)) + +- Add Bittrex Trading In Wallet [\#10](https://github.com/OpalCoin/OpalCoin/pull/10) ([whitj00](https://github.com/whitj00)) + +- Merge Opacity [\#8](https://github.com/OpalCoin/OpalCoin/pull/8) ([whitj00](https://github.com/whitj00)) + +- Revert "Merge Opacity" [\#7](https://github.com/OpalCoin/OpalCoin/pull/7) ([whitj00](https://github.com/whitj00)) + +- Merge Opacity [\#6](https://github.com/OpalCoin/OpalCoin/pull/6) ([coolcash](https://github.com/coolcash)) + +- Revert "Add Encrypted Messaging to Opalcoin" [\#3](https://github.com/OpalCoin/OpalCoin/pull/3) ([coolcash](https://github.com/coolcash)) + +- Add Encrypted Messaging to Opalcoin [\#1](https://github.com/OpalCoin/OpalCoin/pull/1) ([whitj00](https://github.com/whitj00)) + +- Add In-Wallet Trading \(OpalEx\) to opalcoin [\#9](https://github.com/OpalCoin/OpalCoin/pull/9) ([whitj00](https://github.com/whitj00)) + +- Add Opacity Encrypted Messaging to Opalcoin [\#5](https://github.com/OpalCoin/OpalCoin/pull/5) ([whitj00](https://github.com/whitj00)) + +- Update bitcoingui.cpp [\#4](https://github.com/OpalCoin/OpalCoin/pull/4) ([kitaco](https://github.com/kitaco)) + + + +\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)* \ No newline at end of file diff --git a/opalcoin-qt.pro b/opalcoin-qt.pro index c2b5bb20..b92e539d 100644 --- a/opalcoin-qt.pro +++ b/opalcoin-qt.pro @@ -41,7 +41,7 @@ UI_DIR = build OPENSSL_LIB_PATH=/usr/local/opt/openssl/lib MINIUPNPC_INCLUDE_PATH=/usr/local/opt/miniupnpc/include - MINIUPNPC_LIB_PATH=/usr/local/Cellar/miniupnpc/1.8.20131007/lib + MINIUPNPC_LIB_PATH=/usr/local/Cellar/miniupnpc/1.9.20141027/lib QRENCODE_INCLUDE_PATH=/usr/local/opt/qrencode/include QRENCODE_LIB_PATH=/usr/local/opt/qrencode/lib diff --git a/src/main.cpp b/src/main.cpp index b401ed07..ca07502a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2198,6 +2198,13 @@ bool ProcessBlock(CNode* pfrom, CBlock* pblock) return error("ProcessBlock() : block with too little %s", pblock->IsProofOfStake()? "proof-of-stake" : "proof-of-work"); } } + // Be more aggressive with blockchain download. Send new getblocks() message after connection + // to new node if waited longer than MAX_TIME_SINCE_BEST_BLOCK. + int64_t TimeSinceBestBlock = GetTime() - nTimeBestReceived; + if (TimeSinceBestBlock > MAX_TIME_SINCE_BEST_BLOCK) { + printf("INFO: Waiting %"PRId64" sec which is too long. Sending GetBlocks(0)\n", TimeSinceBestBlock); + pfrom->PushGetBlocks(pindexBest, uint256(0)); + } // ppcoin: ask for pending sync-checkpoint if any if (!IsInitialBlockDownload()) @@ -3116,7 +3123,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, // Send the rest of the chain if (pindex) pindex = pindex->pnext; - int nLimit = 500; + int nLimit = 1500; printf("getblocks %d to %s limit %d\n", (pindex ? pindex->nHeight : -1), hashStop.ToString().substr(0,20).c_str(), nLimit); for (; pindex; pindex = pindex->pnext) { @@ -3268,8 +3275,17 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, CInv inv(MSG_BLOCK, hashBlock); pfrom->AddInventoryKnown(inv); - if (ProcessBlock(pfrom, &block)) + if (ProcessBlock(pfrom, &block)) { mapAlreadyAskedFor.erase(inv); + } else { + // Be more aggressive with blockchain download. Send getblocks() message after + // an error related to new block download. + int64_t TimeSinceBestBlock = GetTime() - nTimeBestReceived; + if (TimeSinceBestBlock > MAX_TIME_SINCE_BEST_BLOCK) { + printf("INFO: Waiting %"PRId64" sec which is too long. Sending GetBlocks(0)\n", TimeSinceBestBlock); + pfrom->PushGetBlocks(pindexBest, uint256(0)); + } + } if (block.nDoS) pfrom->Misbehaving(block.nDoS); } diff --git a/src/main.h b/src/main.h index e0b032fe..79066f24 100644 --- a/src/main.h +++ b/src/main.h @@ -43,6 +43,7 @@ static const int64_t MAX_MONEY = 15000248 * COIN; //Does not reflect actual tota static const int64_t COIN_YEAR_REWARD = 5 * CENT; // 5% per year static const int64_t MAX_MINT_PROOF_OF_STAKE = 0.05 * COIN; // 5% Annual PoS Interest static const int MODIFIER_INTERVAL_SWITCH = 15000; +static const int MAX_TIME_SINCE_BEST_BLOCK = 5; // how many seconds to wait before sending next PushGetBlocks() inline bool MoneyRange(int64_t nValue) { return (nValue >= 0 && nValue <= MAX_MONEY); } // Threshold for nLockTime: below this value it is interpreted as block number, otherwise as UNIX timestamp.