diff --git a/INSTALL b/INSTALL index e8a36dc..494bc02 100644 --- a/INSTALL +++ b/INSTALL @@ -7,7 +7,7 @@ Use the autogen script to prepare the build environment. make user gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.5) Precompiled binaries are available at github, see -https://github.com/poppay/pop-binaries +https://github.com/PopchainOrg/PopChain-gho Always verify the signatures and checksums. diff --git a/configure.ac b/configure.ac index bf62017..42b1619 100644 --- a/configure.ac +++ b/configure.ac @@ -6,7 +6,7 @@ define(_CLIENT_VERSION_REVISION, 0) define(_CLIENT_VERSION_BUILD, 0) define(_CLIENT_VERSION_IS_RELEASE, true) define(_COPYRIGHT_YEAR, 2018) -AC_INIT([Pop Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[https://github.com/poppay/pop/issues],[popcore]) +AC_INIT([Pop Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[https://github.com/PopchainOrg/PopChain-gho],[popcore]) AC_CONFIG_SRCDIR([src/main.cpp]) AC_CONFIG_HEADERS([src/config/pop-config.h]) AC_CONFIG_AUX_DIR([build-aux]) diff --git a/contrib/debian/control b/contrib/debian/control index 52b3229..13c26bd 100644 --- a/contrib/debian/control +++ b/contrib/debian/control @@ -1,8 +1,8 @@ Source: pop Section: utils Priority: optional -Maintainer: Holger Schinzel -Uploaders: Holger Schinzel +Maintainer: Holger Schinzel +Uploaders: Holger Schinzel Build-Depends: debhelper, devscripts, automake, @@ -24,9 +24,9 @@ Build-Depends: debhelper, libprotobuf-dev, protobuf-compiler, python Standards-Version: 3.9.2 -Homepage: https://www.pop.org/ -Vcs-Git: git://github.com/poppay/pop.git -Vcs-Browser: https://github.com/poppay/pop +Homepage: https://popchain.org/popchain +Vcs-Git: git://github.com/PopchainOrg/PopChain-gho.git +Vcs-Browser: https://popchain.org/popchain Package: popd Architecture: any diff --git a/contrib/debian/watch b/contrib/debian/watch index 852bd68..4e546ad 100644 --- a/contrib/debian/watch +++ b/contrib/debian/watch @@ -2,4 +2,4 @@ version=3 # use qa.debian.org redirector; see man uscan opts=uversionmangle=s/(\d)(alpha|beta|rc)/$1~$2/,dversionmangle=s/~dfsg\d*// \ - http://githubredir.debian.net/github/poppay/pop v(.*).tar.gz + https://github.com/PopchainOrg/PopChain-gho v(.*).tar.gz diff --git a/contrib/gitian-descriptors/README.md b/contrib/gitian-descriptors/README.md index d909f3a..8e11018 100644 --- a/contrib/gitian-descriptors/README.md +++ b/contrib/gitian-descriptors/README.md @@ -19,8 +19,8 @@ Sanity checks: Once you've got the right hardware and software: - git clone git://github.com/poppay/pop.git - git clone git://github.com/devrandom/gitian-builder.git + git clone git://github.com/PopchainOrg/PopChain-gho.git + git clone git://github.com/PopchainOrg/PopChain-gho.git mkdir gitian-builder/inputs cd gitian-builder/inputs @@ -61,5 +61,5 @@ Here's a description of Gavin's setup on OSX 10.6: 5. Still inside Ubuntu, tell gitian-builder to use LXC, then follow the "Once you've got the right hardware and software" instructions above: export USE_LXC=1 - git clone git://github.com/poppay/pop.git + git clone git://github.com/PopchainOrg/PopChain-gho.git ... etc diff --git a/contrib/gitian-descriptors/gitian-linux.yml b/contrib/gitian-descriptors/gitian-linux.yml index e4f8839..812b5c5 100644 --- a/contrib/gitian-descriptors/gitian-linux.yml +++ b/contrib/gitian-descriptors/gitian-linux.yml @@ -20,7 +20,7 @@ packages: - "python" reference_datetime: "2017-01-01 00:00:00" remotes: -- "url": "https://github.com/poppay/pop.git" +- "url": "https://github.com/PopchainOrg/PopChain-gho.git" "dir": "pop" files: [] script: | diff --git a/contrib/gitian-descriptors/gitian-osx-signer.yml b/contrib/gitian-descriptors/gitian-osx-signer.yml index 82f8301..02f3082 100644 --- a/contrib/gitian-descriptors/gitian-osx-signer.yml +++ b/contrib/gitian-descriptors/gitian-osx-signer.yml @@ -8,7 +8,7 @@ packages: - "faketime" reference_datetime: "2017-01-01 00:00:00" remotes: -- "url": "https://github.com/poppay/pop-detached-sigs.git" +- "url": "https://github.com/PopchainOrg/PopChain-gho.git" "dir": "signature" files: - "pop-osx-unsigned.tar.gz" diff --git a/contrib/gitian-descriptors/gitian-osx.yml b/contrib/gitian-descriptors/gitian-osx.yml index 7c5b038..6217b31 100644 --- a/contrib/gitian-descriptors/gitian-osx.yml +++ b/contrib/gitian-descriptors/gitian-osx.yml @@ -23,7 +23,7 @@ packages: - "python" reference_datetime: "2017-01-01 00:00:00" remotes: -- "url": "https://github.com/poppay/pop.git" +- "url": "https://github.com/PopchainOrg/PopChain-gho.git" "dir": "pop" files: - "MacOSX10.9.sdk.tar.gz" diff --git a/contrib/gitian-descriptors/gitian-rpi2.yml b/contrib/gitian-descriptors/gitian-rpi2.yml index b376221..e6b0579 100644 --- a/contrib/gitian-descriptors/gitian-rpi2.yml +++ b/contrib/gitian-descriptors/gitian-rpi2.yml @@ -17,7 +17,7 @@ packages: - "binutils-gold" reference_datetime: "2017-01-01 00:00:00" remotes: -- "url": "https://github.com/poppay/pop.git" +- "url": "https://github.com/PopchainOrg/PopChain-gho.git" "dir": "pop" files: - "raspberrypi-tools.tar.gz" diff --git a/contrib/gitian-descriptors/gitian-win-signer.yml b/contrib/gitian-descriptors/gitian-win-signer.yml index 480efc0..036ac2e 100644 --- a/contrib/gitian-descriptors/gitian-win-signer.yml +++ b/contrib/gitian-descriptors/gitian-win-signer.yml @@ -9,7 +9,7 @@ packages: - "autoconf" reference_datetime: "2017-01-01 00:00:00" remotes: -- "url": "https://github.com/poppay/pop-detached-sigs.git" +- "url": "https://github.com/PopchainOrg/PopChain-gho.git" "dir": "signature" files: - "osslsigncode-1.7.1.tar.gz" diff --git a/contrib/gitian-descriptors/gitian-win.yml b/contrib/gitian-descriptors/gitian-win.yml index 2437b38..95957b4 100644 --- a/contrib/gitian-descriptors/gitian-win.yml +++ b/contrib/gitian-descriptors/gitian-win.yml @@ -23,7 +23,7 @@ packages: - "python" reference_datetime: "2017-01-01 00:00:00" remotes: -- "url": "https://github.com/poppay/pop.git" +- "url": "https://github.com/PopchainOrg/PopChain-gho.git" "dir": "pop" files: [] script: | diff --git a/contrib/linearize/README.md b/contrib/linearize/README.md index 3d96ca3..3051c50 100644 --- a/contrib/linearize/README.md +++ b/contrib/linearize/README.md @@ -3,7 +3,7 @@ Construct a linear, no-fork, best version of the blockchain. ## Step 0: Install pop_hash -https://github.com/poppay/pop_hash +https://github.com/PopchainOrg/PopChain-gho ## Step 1: Download hash list diff --git a/contrib/verify-commits/pre-push-hook.sh b/contrib/verify-commits/pre-push-hook.sh index 900643a..72cc427 100644 --- a/contrib/verify-commits/pre-push-hook.sh +++ b/contrib/verify-commits/pre-push-hook.sh @@ -1,5 +1,5 @@ #!/bin/bash -if ! [[ "$2" =~ ^(git@)?(www.)?github.com(:|/)poppay/pop(.git)?$ ]]; then +if ! [[ "$2" =~ ^(git@)?(www.)?github.com(:|/)PopchainOrg/PopChain-gho(.git)?$ ]]; then exit 0 fi diff --git a/doc/README.md b/doc/README.md index a9707b0..1337a98 100644 --- a/doc/README.md +++ b/doc/README.md @@ -24,10 +24,10 @@ Drag Pop-Qt to your applications folder, and then run Pop-Qt. ### Need Help? -* See the [Pop documentation](https://poppay.atlassian.net/wiki/display/DOC) +* See the [Pop documentation](https://github.com/PopchainOrg/PopChain-gho/tree/master/doc) for help and more information. -* Ask for help on [#poppay](http://webchat.freenode.net?channels=poppay) on Freenode. If you don't have an IRC client use [webchat here](http://webchat.freenode.net?channels=poppay). -* Ask for help on the [PopTalk](https://poptalk.org/) forums. +* Ask for help on [Telegram](https://t.me/popchain_global) on Freenode. If you don't have an IRC client use [Twitter](https://twitter.com/POPCHAIN_Global). +* Ask for help on the [web](https://popchain.org/popchain/) forums. Building --------------------- @@ -57,8 +57,8 @@ The Pop Core repo's [root README](/README.md) contains relevant information on t - [Dnsseed Policy](dnsseed-policy.md) ### Resources -* Discuss on the [PopTalk](https://poptalk.org/) forums, in the Development & Technical Discussion board. -* Discuss on [#poppay](http://webchat.freenode.net/?channels=poppay) on Freenode. If you don't have an IRC client use [webchat here](http://webchat.freenode.net/?channels=poppay). +* Discuss on the [web](https://popchain.org/popchain/) forums, in the Development & Technical Discussion board. +* Discuss on [#Telegram](https://t.me/popchain_global) on Freenode. If you don't have an IRC client use [Twitter here](https://twitter.com/POPCHAIN_Global). ### Miscellaneous - [Assets Attribution](assets-attribution.md) @@ -70,4 +70,4 @@ License --------------------- Distributed under the [MIT software license](http://www.opensource.org/licenses/mit-license.php). This product includes software developed by the OpenSSL Project for use in the [OpenSSL Toolkit](https://www.openssl.org/). This product includes -cryptographic software written by Eric Young ([eay@cryptsoft.com](mailto:eay@cryptsoft.com)), and UPnP software written by Thomas Bernard. + diff --git a/doc/README_windows.txt b/doc/README_windows.txt index c640aea..0a44b2a 100644 --- a/doc/README_windows.txt +++ b/doc/README_windows.txt @@ -19,5 +19,5 @@ depending on the speed of your computer and network connection, the synchronizat process can take anywhere from a few hours to a day or more. See the pop wiki at: - https://poppay.atlassian.net/wiki/ + http://coinwik.org/POPCHAIN for more help and information. diff --git a/doc/gitian-building.md b/doc/gitian-building.md index f150f73..b938796 100644 --- a/doc/gitian-building.md +++ b/doc/gitian-building.md @@ -11,7 +11,7 @@ the same, tested dependencies are used and statically built into the executable. Multiple developers build the source code by following a specific descriptor ("recipe"), cryptographically sign the result, and upload the resulting signature. These results are compared and only if they match, the build is accepted and uploaded -to pop.org. +to popchain.org. More independent Gitian builders are needed, which is why this guide exists. It is preferred you follow these steps yourself instead of using someone else's @@ -303,8 +303,8 @@ cd .. Clone the git repositories for Pop Core and Gitian. ```bash -git clone https://github.com/devrandom/gitian-builder.git -git clone https://github.com/poppay/pop +git clone https://github.com/PopchainOrg/PopChain-gho.git +git clone https://github.com/PopchainOrg/PopChain-gho.git ``` Setting up the Gitian image @@ -368,7 +368,7 @@ Output from `gbuild` will look something like remote: Total 57959 (delta 0), reused 0 (delta 0), pack-reused 57958 Receiving objects: 100% (57959/57959), 53.76 MiB | 484.00 KiB/s, done. Resolving deltas: 100% (41590/41590), done. - From https://github.com/poppay/pop + From https://github.com/PopchainOrg/PopChain-gho ... (new tags, new branch etc) --- Building for precise amd64 --- Stopping target if it is up @@ -394,7 +394,7 @@ and inputs. For example: ```bash -URL=https://github.com/crowning-/pop.git +URL=https://github.com/PopchainOrg/PopChain-gho.git COMMIT=b616fb8ef0d49a919b72b0388b091aaec5849b96 ./bin/gbuild --commit pop=${COMMIT} --url pop=${URL} ../pop/contrib/gitian-descriptors/gitian-linux.yml ./bin/gbuild --commit pop=${COMMIT} --url pop=${URL} ../pop/contrib/gitian-descriptors/gitian-win.yml @@ -444,10 +444,10 @@ Then when building, override the remote URLs that gbuild would otherwise pull fr ```bash cd /some/root/path/ -git clone https://github.com/poppay/pop-detached-sigs.git +git clone https://github.com/PopchainOrg/PopChain-gho.git -UCPATH=/some/root/path/pop.git -SIGPATH=/some/root/path/pop-detached-sigs.git +UCPATH=/some/root/path/PopChain-gho.git +SIGPATH=/some/root/path/PopChain-gho.git ./bin/gbuild --url pop=${UCPATH},signature=${SIGPATH} ../pop/contrib/gitian-descriptors/gitian-win-signer.yml ``` @@ -476,6 +476,6 @@ Uploading signatures (not yet implemented) --------------------- In the future it will be possible to push your signatures (both the `.assert` and `.assert.sig` files) to the -[pop/gitian.sigs](https://github.com/poppay/gitian.sigs/) repository, or if that's not possible to create a pull +[pop](https://github.com/PopchainOrg/PopChain-gho/) repository, or if that's not possible to create a pull request. There will be an official announcement when this repository is online. diff --git a/doc/guide-startmany.md b/doc/guide-startmany.md index 5daa5d0..ef6767c 100644 --- a/doc/guide-startmany.md +++ b/doc/guide-startmany.md @@ -95,7 +95,7 @@ Issue the following: Make note of the hash (which is your collateral_output) and index. ### Enter your Popnode details into your popnode.conf file -[From the pop github repo](https://github.com/poppay/pop/blob/master/doc/popnode_conf.md) +[From the pop github repo](https://github.com/PopchainOrg/PopChain-gho/tree/master/doc/popnode_conf.md) `popnode.conf` format is a space seperated text file. Each line consisting of an alias, IP address followed by port, popnode private key, collateral output transaction id and collateral output index. @@ -135,7 +135,7 @@ You can confirm that remote server is on the correct block by issuing ```pop-cli getinfo``` -and comparing with the official explorer at https://explorer.pop.org/chain/Pop +and comparing with the official explorer at https://popchain.org/popchain ### Local @@ -174,6 +174,6 @@ Command output should have "_Popnode successfully started_" in its `status` fiel ### Local -Search your Popnodes on https://popninja.pl/popnodes.html +Search your Popnodes on https://popchain.org/popchain _Hint: Bookmark it, you definitely will be using this site a lot._ diff --git a/doc/keepass.md b/doc/keepass.md index 1c103fe..ae14357 100644 --- a/doc/keepass.md +++ b/doc/keepass.md @@ -51,4 +51,4 @@ At this point, the association is made. The next action depends on your particul At this point, the passphrase is stored in KeePassHttp. When Unlocking the wallet, one can use _keepass_ as the passphrase to trigger retrieval of the password. This works from the RPC commands as well as the GUI. -Extended guide with screenshots is also available: https://poptalk.org/threads/keepass-integration.3620/ +Extended guide with screenshots is also available: https://popchain.org/popchain diff --git a/doc/release-notes.md b/doc/release-notes.md index ecb16e7..ff14025 100644 --- a/doc/release-notes.md +++ b/doc/release-notes.md @@ -1,6 +1,6 @@ Pop Core version 0.12.1 is now available from: - + diff --git a/doc/release-process.md b/doc/release-process.md index fd77872..42b6a3e 100644 --- a/doc/release-process.md +++ b/doc/release-process.md @@ -1,7 +1,7 @@ Release Process ==================== -* Update translations, see [translation_process.md](https://github.com/poppay/pop/blob/master/doc/translation_process.md#syncing-with-transifex) +* Update translations, see [translation_process.md](https://github.com/PopchainOrg/PopChain-gho) * Update hardcoded [seeds](/contrib/seeds) * * * @@ -10,10 +10,10 @@ Release Process Check out the source code in the following directory hierarchy. cd /path/to/your/toplevel/build - git clone https://github.com/poppay/gitian.sigs.git - git clone https://github.com/poppay/pop-detached-sigs.git - git clone https://github.com/devrandom/gitian-builder.git - git clone https://github.com/poppay/pop.git + git clone https://github.com/PopchainOrg/PopChain-gho.git + git clone https://github.com/PopchainOrg/PopChain-gho.git + git clone https://github.com/PopchainOrg/PopChain-gho.git + git clone https://github.com/PopchainOrg/PopChain-gho.git ###Pop Core maintainers/release engineers, update (commit) version in sources @@ -139,7 +139,7 @@ Commit your signature to gitian.sigs: Wait for Windows/OS X detached signatures: Once the Windows/OS X builds each have 3 matching signatures, they will be signed with their respective release keys. - Detached signatures will then be committed to the [pop-detached-sigs](https://github.com/poppay/pop-detached-sigs) repository, which can be combined with the unsigned apps to create signed binaries. + Detached signatures will then be committed to the [pop-detached-sigs](https://github.com/PopchainOrg/PopChain-gho) repository, which can be combined with the unsigned apps to create signed binaries. Create (and optionally verify) the signed OS X binary: @@ -182,21 +182,21 @@ rm SHA256SUMS (the digest algorithm is forced to sha256 to avoid confusion of the `Hash:` header that GPG adds with the SHA256 used for the files) Note: check that SHA256SUMS itself doesn't end up in SHA256SUMS, which is a spurious/nonsensical entry. -- Upload zips and installers, as well as `SHA256SUMS.asc` from last step, to the pop.org server +- Upload zips and installers, as well as `SHA256SUMS.asc` from last step, to the popchain.org server -- Update pop.org +- Update popchain.org - Announce the release: - - Release on Pop forum: https://www.pop.org/forum/topic/official-announcements.54/ + - Release on Pop forum: https://github.com/PopchainOrg/PopChain-gho - Pop-development mailing list - - Update title of #poppay on Freenode IRC + - Update title of #popchain on Freenode IRC - - Optionally reddit /r/Poppay, ... but this will usually sort out itself + - Optionally reddit /r/popchain, ... but this will usually sort out itself -- Notify flare so that he can start building [the PPAs](https://launchpad.net/~pop.org/+archive/ubuntu/pop) +- Notify flare so that he can start building [the PPAs](https://github.com/PopchainOrg/PopChain-gho) - Add release notes for the new version to the directory `doc/release-notes` in git master diff --git a/share/qt/Info.plist.in b/share/qt/Info.plist.in index 0aa1498..2993eca 100755 --- a/share/qt/Info.plist.in +++ b/share/qt/Info.plist.in @@ -46,7 +46,7 @@ CFBundleTypeRole Editor CFBundleURLName - org.pop.PopPayment + org.pop.Payment CFBundleURLSchemes pop @@ -60,7 +60,7 @@ UTTypeIdentifier org.pop.paymentrequest UTTypeDescription - Pop payment request + payment request UTTypeConformsTo public.data @@ -71,7 +71,7 @@ application/x-pop-payment-request public.filename-extension - poppaymentrequest + paymentrequest diff --git a/share/setup.nsi.in b/share/setup.nsi.in index 05e0865..38b3716 100755 --- a/share/setup.nsi.in +++ b/share/setup.nsi.in @@ -7,7 +7,7 @@ SetCompressor /SOLID lzma !define REGKEY "SOFTWARE\$(^Name)" !define VERSION @CLIENT_VERSION_MAJOR@.@CLIENT_VERSION_MINOR@.@CLIENT_VERSION_REVISION@ !define COMPANY "Pop Core project" -!define URL https://www.pop.org/ +!define URL https://popchain.org/popchain # MUI Symbol Definitions !define MUI_ICON "@abs_top_srcdir@/share/pixmaps/bitcoin.ico" diff --git a/src/addrman.cpp b/src/addrman.cpp index 86c718c..9ed5068 100644 --- a/src/addrman.cpp +++ b/src/addrman.cpp @@ -5,6 +5,7 @@ #include "hash.h" #include "serialize.h" #include "streams.h" +#include "random.h" // addr manager user hash table . int CAddrInfo::GetTriedBucket(const uint256& nKey) const { @@ -22,6 +23,11 @@ int CAddrInfo::GetNewBucket(const uint256& nKey, const CNetAddr& src) const return hash2 % ADDRMAN_NEW_BUCKET_COUNT; } +int CAddrInfo::GetNewBucket(const uint256 &nKey) const +{ + return GetNewBucket(nKey, source); +} + int CAddrInfo::GetBucketPosition(const uint256 &nKey, bool fNew, int nBucket) const { uint64_t hash1 = (CHashWriter(SER_GETHASH, 0) << nKey << (fNew ? 'N' : 'K') << nBucket << GetKey()).GetHash().GetCheapHash(); @@ -73,6 +79,16 @@ CAddrInfo* CAddrMan::Create(const CAddress& addr, const CNetAddr& addrSource, in return &mapInfo[nId]; } +CAddrInfo::CAddrInfo() : CAddress(), source() +{ + Init(); +} + +CAddrInfo::CAddrInfo(const CAddress &addrIn, const CNetAddr &addrSource) : CAddress(addrIn), source(addrSource) +{ + Init(); +} + double CAddrInfo::GetChance(int64_t nNow) const { double fChance = 1.0; @@ -129,6 +145,26 @@ void CAddrMan::SwapRandom(unsigned int nRndPos1, unsigned int nRndPos2) vRandom[nRndPos2] = nId1; } +void CAddrMan::Clear() +{ + std::vector().swap(vRandom); + nKey = GetRandHash(); + for (size_t bucket = 0; bucket < ADDRMAN_NEW_BUCKET_COUNT; bucket++) { + for (size_t entry = 0; entry < ADDRMAN_BUCKET_SIZE; entry++) { + vvNew[bucket][entry] = -1; + } + } + for (size_t bucket = 0; bucket < ADDRMAN_TRIED_BUCKET_COUNT; bucket++) { + for (size_t entry = 0; entry < ADDRMAN_BUCKET_SIZE; entry++) { + vvTried[bucket][entry] = -1; + } + } + + nIdCount = 0; + nTried = 0; + nNew = 0; +} + void CAddrMan::ClearNew(int nUBucket, int nUBucketPos) { // if there is an entry in the specified bucket, delete it. @@ -375,6 +411,10 @@ void CAddrMan::Good_(const CService& addr, int64_t nTime) MakeTried(info, nId); } +unsigned int CAddrMan::GetSerializeSize(int nType, int nVersion) const +{ + return (CSizeComputer(nType, nVersion) << *this).size(); +} #ifdef DEBUG_ADDRMAN int CAddrMan::Check_() diff --git a/src/addrman.h b/src/addrman.h index 6d0e7a0..2df88eb 100644 --- a/src/addrman.h +++ b/src/addrman.h @@ -69,15 +69,9 @@ class CAddrInfo : public CAddress nRandomPos = -1; } - CAddrInfo(const CAddress &addrIn, const CNetAddr &addrSource) : CAddress(addrIn), source(addrSource) - { - Init(); - } + CAddrInfo(const CAddress &addrIn, const CNetAddr &addrSource); - CAddrInfo() : CAddress(), source() - { - Init(); - } + CAddrInfo(); //! Calculate in which "tried" bucket this entry belongs int GetTriedBucket(const uint256 &nKey) const; @@ -86,11 +80,8 @@ class CAddrInfo : public CAddress int GetNewBucket(const uint256 &nKey, const CNetAddr& src) const; //! Calculate in which "new" bucket this entry belongs, using its default source - int GetNewBucket(const uint256 &nKey) const - { - return GetNewBucket(nKey, source); - } - + int GetNewBucket(const uint256 &nKey) const; + //! Calculate in which position of a bucket to store this entry. int GetBucketPosition(const uint256 &nKey, bool fNew, int nBucket) const; @@ -424,30 +415,9 @@ class CAddrMan Check(); } - unsigned int GetSerializeSize(int nType, int nVersion) const - { - return (CSizeComputer(nType, nVersion) << *this).size(); - } - - void Clear() - { - std::vector().swap(vRandom); - nKey = GetRandHash(); - for (size_t bucket = 0; bucket < ADDRMAN_NEW_BUCKET_COUNT; bucket++) { - for (size_t entry = 0; entry < ADDRMAN_BUCKET_SIZE; entry++) { - vvNew[bucket][entry] = -1; - } - } - for (size_t bucket = 0; bucket < ADDRMAN_TRIED_BUCKET_COUNT; bucket++) { - for (size_t entry = 0; entry < ADDRMAN_BUCKET_SIZE; entry++) { - vvTried[bucket][entry] = -1; - } - } + unsigned int GetSerializeSize(int nType, int nVersion) const; - nIdCount = 0; - nTried = 0; - nNew = 0; - } + void Clear(); CAddrMan() { diff --git a/src/dbpacker.cpp b/src/dbpacker.cpp index 137c80a..f9c8375 100644 --- a/src/dbpacker.cpp +++ b/src/dbpacker.cpp @@ -61,7 +61,7 @@ CDBPacker::CDBPacker(const boost::filesystem::path& path, size_t nCacheSize, boo leveldb::Status result = leveldb::DestroyDB(path.string(), options); HandleError(result); } - TryCreateDirectory(path); + CreateDirectory(path); LogPrintf("Opening LevelDB in %s\n", path.string()); } leveldb::Status status = leveldb::DB::Open(options, path.string(), &pdb); diff --git a/src/init.cpp b/src/init.cpp index 858033c..c4a5f7b 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -553,7 +553,7 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += HelpMessageOpt("-privdb", strprintf("Sets the DB_PRIVATE flag in the wallet db environment (default: %u)", DEFAULT_WALLET_PRIVDB)); #endif } - strUsage += HelpMessageOpt("-shrinkdebugfile", _("Shrink debug.log file on client startup (default: 1 when no -debug)")); + strUsage += HelpMessageOpt("-reducedebugfile", _("Reduce debug.log file on client startup (default: 1 when no -debug)")); AppendParamsHelpMessages(strUsage, showDebug); strUsage += HelpMessageOpt("-litemode=", strprintf(_("Disable all Pop specific functionality (Popnodes, PrivateSend, InstantSend) (0-1, default: %u)"), 0)); @@ -1185,8 +1185,8 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) #ifndef WIN32 CreatePidFile(GetPidFile(), getpid()); #endif - if (GetBoolArg("-shrinkdebugfile", !fDebug)) - ShrinkDebugFile(); + if (GetBoolArg("-reducedebugfile", !fDebug)) + ReduceDebugFile(); if (fPrintToDebugLog) OpenDebugLog(); diff --git a/src/popd.cpp b/src/popd.cpp index 2489352..9f529ad 100644 --- a/src/popd.cpp +++ b/src/popd.cpp @@ -24,7 +24,7 @@ * * \section intro_sec Introduction * - * This is the developer documentation of the reference client for an experimental new digital currency called Pop (https://www.pop.org/), + * This is the developer documentation of the reference client for an experimental new digital currency called Pop (https://popchain.org/popchain/), * which enables instant payments to anyone, anywhere in the world. Pop uses peer-to-peer technology to operate * with no central authority: managing transactions and issuing money are carried out collectively by the network. * diff --git a/src/qt/guiconstants.h b/src/qt/guiconstants.h index 646dc93..b72f7a5 100644 --- a/src/qt/guiconstants.h +++ b/src/qt/guiconstants.h @@ -45,7 +45,7 @@ static const int MAX_URI_LENGTH = 255; #define SPINNER_FRAMES 36 #define QAPP_ORG_NAME "Pop" -#define QAPP_ORG_DOMAIN "pop.org" +#define QAPP_ORG_DOMAIN "popchain.org" #define QAPP_APP_NAME_DEFAULT "Pop-Qt" #define QAPP_APP_NAME_TESTNET "Pop-Qt-testnet" diff --git a/src/qt/intro.cpp b/src/qt/intro.cpp index 9e52787..422bf36 100644 --- a/src/qt/intro.cpp +++ b/src/qt/intro.cpp @@ -188,7 +188,7 @@ void Intro::pickDataDirectory() } dataDir = intro.getDataDirectory(); try { - TryCreateDirectory(GUIUtil::qstringToBoostPath(dataDir)); + CreateDirectory(GUIUtil::qstringToBoostPath(dataDir)); break; } catch (const fs::filesystem_error&) { QMessageBox::critical(0, tr("Pop Core"), diff --git a/src/qt/utilitydialog.cpp b/src/qt/utilitydialog.cpp index 384df0e..cebb6a6 100644 --- a/src/qt/utilitydialog.cpp +++ b/src/qt/utilitydialog.cpp @@ -163,7 +163,7 @@ your funds will already be anonymized. No additional waiting is required. \ This means those 1000 addresses last for about 100 mixing events. When 900 of them are used, your wallet must create more addresses. \ It can only do this, however, if you have automatic backups enabled.
\ Consequently, users who have backups disabled will also have PrivateSend disabled.
\ -For more info see https://poppay.atlassian.net/wiki/display/DOC/PrivateSend \ +For more info see https://github.com/PopchainOrg/PopChain-gho/tree/master/doc \ ")); ui->aboutMessage->setWordWrap(true); ui->helpMessage->setVisible(false); diff --git a/src/util.cpp b/src/util.cpp index 1674501..f1f9e9a 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -217,6 +217,30 @@ static void DebugPrintInit() vMsgsBeforeOpenLog = new list; } +void ReduceDebugFile() +{ + // Scroll debug.log if it's getting too big + boost::filesystem::path logPath = GetDataDir() / "debug.log"; + FILE* file = fopen(logPath.string().c_str(), "r"); + if (file && boost::filesystem::file_size(logPath) > 10 * 1000000) + { + // Restart the file with some of the end + std::vector vch(200000,0); + fseek(file, -((long)vch.size()), SEEK_END); + int nBytes = fread(begin_ptr(vch), 1, vch.size(), file); + fclose(file); + + file = fopen(logPath.string().c_str(), "w"); + if (file) + { + fwrite(begin_ptr(vch), 1, nBytes, file); + fclose(file); + } + } + else if (file != NULL) + fclose(file); +} + void OpenDebugLog() { boost::call_once(&DebugPrintInit, debugPrintInitFlag); @@ -238,6 +262,25 @@ void OpenDebugLog() vMsgsBeforeOpenLog = NULL; } +/** + * Ignores exceptions thrown by Boost's create_directory if the requested directory exists. + * Specifically handles case where path p exists, but it wasn't possible for the user to + * write to the parent directory. + */ +bool CreateDirectory(const boost::filesystem::path& path) +{ + try + { + return boost::filesystem::create_directory(path); + } catch (const boost::filesystem::filesystem_error&) { + if (!boost::filesystem::exists(path) || !boost::filesystem::is_directory(path)) + throw; + } + + // create_directory didn't create the directory, it had to have existed already + return false; +} + bool LogAcceptCategory(const char* category) { if (category != NULL) @@ -683,25 +726,6 @@ bool RenameOver(boost::filesystem::path src, boost::filesystem::path dest) #endif /* WIN32 */ } -/** - * Ignores exceptions thrown by Boost's create_directory if the requested directory exists. - * Specifically handles case where path p exists, but it wasn't possible for the user to - * write to the parent directory. - */ -bool TryCreateDirectory(const boost::filesystem::path& p) -{ - try - { - return boost::filesystem::create_directory(p); - } catch (const boost::filesystem::filesystem_error&) { - if (!boost::filesystem::exists(p) || !boost::filesystem::is_directory(p)) - throw; - } - - // create_directory didn't create the directory, it had to have existed already - return false; -} - void FileCommit(FILE *fileout) { fflush(fileout); // harmless if redundantly called @@ -796,30 +820,6 @@ void AllocateFileRange(FILE *file, unsigned int offset, unsigned int length) { #endif } -void ShrinkDebugFile() -{ - // Scroll debug.log if it's getting too big - boost::filesystem::path pathLog = GetDataDir() / "debug.log"; - FILE* file = fopen(pathLog.string().c_str(), "r"); - if (file && boost::filesystem::file_size(pathLog) > 10 * 1000000) - { - // Restart the file with some of the end - std::vector vch(200000,0); - fseek(file, -((long)vch.size()), SEEK_END); - int nBytes = fread(begin_ptr(vch), 1, vch.size(), file); - fclose(file); - - file = fopen(pathLog.string().c_str(), "w"); - if (file) - { - fwrite(begin_ptr(vch), 1, nBytes, file); - fclose(file); - } - } - else if (file != NULL) - fclose(file); -} - #ifdef WIN32 boost::filesystem::path GetSpecialFolderPath(int nFolder, bool fCreate) { diff --git a/src/util.h b/src/util.h index b627407..8a7a47a 100644 --- a/src/util.h +++ b/src/util.h @@ -129,15 +129,15 @@ static inline bool error(const char* format) LogPrintStr(std::string("ERROR: ") + format + "\n"); return false; } - +void ReduceDebugFile(); void PrintExceptionContinue(const std::exception *pex, const char* pszThread); void ParseParameters(int argc, const char*const argv[]); void FileCommit(FILE *fileout); bool TruncateFile(FILE *file, unsigned int length); +bool CreateDirectory(const boost::filesystem::path& path); int RaiseFileDescriptorLimit(int nMinFD); void AllocateFileRange(FILE *file, unsigned int offset, unsigned int length); bool RenameOver(boost::filesystem::path src, boost::filesystem::path dest); -bool TryCreateDirectory(const boost::filesystem::path& p); boost::filesystem::path GetDefaultDataDir(); const boost::filesystem::path &GetDataDir(bool fNetSpecific = true); const boost::filesystem::path &GetBackupsDir(); @@ -154,7 +154,6 @@ boost::filesystem::path GetSpecialFolderPath(int nFolder, bool fCreate = true); #endif boost::filesystem::path GetTempPath(); void OpenDebugLog(); -void ShrinkDebugFile(); void runCommand(const std::string& strCommand); inline bool IsSwitchChar(char c) diff --git a/src/wallet/db.cpp b/src/wallet/db.cpp index 555cdf9..044469b 100644 --- a/src/wallet/db.cpp +++ b/src/wallet/db.cpp @@ -77,7 +77,7 @@ bool CDBEnv::Open(const boost::filesystem::path& pathIn) strPath = pathIn.string(); boost::filesystem::path pathLogDir = pathIn / "database"; - TryCreateDirectory(pathLogDir); + CreateDirectory(pathLogDir); boost::filesystem::path pathErrorFile = pathIn / "db.log"; LogPrintf("CDBEnv::Open: LogDir=%s ErrorFile=%s\n", pathLogDir.string(), pathErrorFile.string());