[Dev] Documenting Feathercoin Specific Software settings - Part 14
-
Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*
Patch missing :: commit
Bug fix
https://github.com/FeatherCoin/Feathercoin/commit/f0229d3371cf2811ded7ad8641c1a1834862c2d9
src/main.cpp
- LogPrintf("CheckProofOfWork() hash=%s \n",hash.ToString().c_str()); + //LogPrintf("CheckProofOfWork() hash=%s \n",hash.ToString().c_str()); + //LogPrintf("CheckProofOfWork() nBits=%i \n",nBits); + //LogPrintf("CheckProofOfWork() bnTarget.getuint256=%s \n",bnTarget.getuint256().ToString().c_str()); + LogPrintf("SetBestChain:100 chainActive nHeight=%d,BlockHash=%s\n",pindexOldTip->nHeight,pindexOldTip->GetBlockHash().ToString()); + LogPrintf("SetBestChain:100 pindexNew + LogPrintf("SetBestChain:110 pfork nHeight=%d,BlockHash=%s\n",pfork->nHeight,pfork->GetBlockHash().ToString()); + LogPrintf("SetBestChain:120: Disconnect %"PRIszu" blocks; %s...\n", vDisconnect.size(), pfork->GetBlockHash().ToString()); + LogPrintf("SetBestChain:120: Connect %"PRIszu" blocks; ...%s\n", vConnect.size(), pindexNew->GetBlockHash().ToString());
Code replaced
+ // Disconnect shorter branch + vector<CTransaction> vResurrect; + BOOST_FOREACH(CBlockIndex* pindex, vDisconnect) { + CBlock block; + if (!ReadBlockFromDisk(block, pindex)) + return state.Abort(_("Failed to read block")); + int64 nStart = GetTimeMicros(); + bool fClean = true; + if (!DisconnectBlock(block, state, pindex, view, &fClean)) + return error("SetBestBlock() : DisconnectBlock %s failed", pindex->GetBlockHash().ToString().c_str()); + if (fBenchmark) + LogPrintf("- Disconnect: %.2fms\n", (GetTimeMicros() - nStart) * 0.001); + + // Queue memory transactions to resurrect. + // We only do this for blocks after the last checkpoint (reorganisation before that + // point should only happen with -reindex/-loadblock, or a misbehaving peer. + BOOST_FOREACH(const CTransaction& tx, block.vtx) + if (!tx.IsCoinBase() && pindex->nHeight > Checkpoints::GetTotalBlocksEstimate()) + vResurrect.push_back(tx); + } + + // Connect longer branch + vector<CTransaction> vDelete; + BOOST_FOREACH(CBlockIndex *pindex, vConnect) { + CBlock block; + if (!ReadBlockFromDisk(block, pindex)) + return state.Abort(_("Failed to read block")); + int64 nStart = GetTimeMicros(); + if (!ConnectBlock(block, state, pindex, view)) { + if (state.IsInvalid()) { + InvalidChainFound(pindexNew); + InvalidBlockFound(pindex,state); + } + return error("SetBestBlock() : ConnectBlock %s failed", pindex->GetBlockHash().ToString().c_str()); + } + if (fBenchmark) + LogPrintf("- Connect: %.2fms\n", (GetTimeMicros() - nStart) * 0.001); + + // Queue memory transactions to delete + BOOST_FOREACH(const CTransaction& tx, block.vtx) + vDelete.push_back(tx); + } + LogPrintf("SetBestChain:130: \n"); + + // Flush changes to global coin state + int64 nStart = GetTimeMicros(); + int nModified = view.GetCacheSize(); + assert(view.Flush()); + int64 nTime = GetTimeMicros() - nStart; + if (fBenchmark) + LogPrintf("- Flush %i transactions: %.2fms (%.4fms/tx)\n", nModified, 0.001 * nTime, 0.001 * nTime / nModified); + + if (!WriteChainState(state)) + return false; + + // Resurrect memory transactions that were in the disconnected branch + BOOST_FOREACH(CTransaction& tx, vResurrect) { + // ignore validation errors in resurrected transactions + CValidationState stateDummy; + list<CTransaction> removed; + if (!AcceptToMemoryPool(mempool, stateDummy, tx, false, NULL)) + mempool.remove(tx, removed, true); + } + // Delete redundant memory transactions that are in the connected branch + list<CTransaction> txConflicted; + BOOST_FOREACH(CTransaction& tx, vDelete) { + list<CTransaction> removed; + mempool.remove(tx, removed); + mempool.removeConflicts(tx, txConflicted); + } + mempool.check(pcoinsTip); + LogPrintf("SetBestChain:140: \n"); + + UpdateTip(pindexNew); + + // Tell wallet about transactions that went from mempool to conflicted: + BOOST_FOREACH(const CTransaction &tx, txConflicted) { + SyncWithWallets(tx.GetHash(), tx, NULL); + }
Code added
+ LogPrintf("SetBestChain:150 true.\n");
Code replaced
- //return (pnext || this == chainActive.Tip());
Comment removed
-
Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*
Updated FTC Install dependencies guide, build zxing (c++ version) :: commit
Various layout changes, dependency updates and build zxing help
https://github.com/FeatherCoin/Feathercoin/commit/b54181e2bb36983ba35933845203a182a966deef
doc/README.md
+ sudo apt-get install libqt5printsupport5 libqt5opengl5-dev
Now Qt5
+ sudo apt-get install libqt5gui5 libqt5core5a libqt5dbus5
Now libqt5core5a
+ sudo apt-get install libssl-dev
Typo no install
+### If PPA or .deb does not work, compile the zxing libraries yourself, download the sources from github.com. + +Search for zxing-cpp to get the c++ version of the code. + +https://github.com/glassechidna/zxing-cpp + +Build command for libzxing : +export CXXFLAGS="-D_GLIBCXX_USE_CXX11_ABI=0" +cmake -G “Unix Makefiles” … -D_GLIBCXX_USE_CXX11_ABI=0 -DCMAKE_BUILD_TYPE=Release +make +sudo make install
Additional code / build instruction text
-
Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*
Updated FTC Install dependencies guide, build zxing (c++ version) :: commit
Various MD layout changes
https://github.com/FeatherCoin/Feathercoin/commit/20e75314f47ff6bb8d625bcee86c934b76a8679a
doc/README.md
+mkdir build +cd build
Extra instructions for zxing build
-
Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*
Further tweeks to zxing build from source instructions :: commit
Various MD layout changes
https://github.com/FeatherCoin/Feathercoin/commit/4a1fd9b460e266ee74af34a6bc10b73c7001aba7
doc/README.md
+cmake -G “Unix Makefiles”.. -D_GLIBCXX_USE_CXX11_ABI=0 -DCMAKE_BUILD_TYPE=Release
Instructions don’t copy from markdown. …
+--with-incompatible-bdb
Additional build instructions available
-
Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*
Further tweeks to zxing build from source instructions :: commit
Various MD layout changes, further updates
https://github.com/FeatherCoin/Feathercoin/commit/acb5abcbbeac0cec38fe9665f364900704d01f60
doc/README.md
-export CXXFLAGS="-D_GLIBCXX_USE_CXX11_ABI=0" +export CXXFLAGS="-fPIC"
Code replaced
+sudo nano /usr/local/include/zxing/LuminanceSource.h +On Line 30 : Change public to private:
Code replaced
+ ./configure --with-gui=qt5 --enable-tests=no --with-incompatible-bdb --enable-upnp-default --with-qrcode=yes
Additional switches
+### Build Berkley database version 4.8 from source. + +wget http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz +tar -xzvf db-4.8.30.NC.tar.gz +cd db-4.8.30.NC/build_unix/ +…/dist/configure --enable-cxx +make +sudo make install + +Example config usage : + +./configure --disable-upnp-default --disable-tests --with-boost-libdir=/usr/lib/arm-linux-gnueabihf CPPFLAGS="-I/usr/local/BerkeleyDB.4.8/include -O2" LDFLAGS="-L/usr/local/BerkeleyDB.4.8/lib"
Add code for Berkelay self build
-
Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*
** Updated main.cpp to remove unused variable :: commit**
Updated main.cpp to remove unused variable pblockindexFBBHLast and ./…
…autoconfig.sh to use autoupdate
https://github.com/FeatherCoin/Feathercoin/commit/acb5abcbbeac0cec38fe9665f364900704d01f60
-autoreconf -if --warnings=all +autoupdate +autoreconf -if --warnings=all
Code replaced
-
Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*
** Updated main.cpp to remove unused variable :: commit**
Updated main.cpp to remove unused variable pblockindexFBBHLast and ./…
…autoconfig.sh to use autoupdate
https://github.com/FeatherCoin/Feathercoin/commit/acb5abcbbeac0cec38fe9665f364900704d01f60
src/main.cpp
-static CBlockIndex* pblockindexFBBHLast; +// pblockindexFBBHLast : no longer used +// static CBlockIndex* pblockindexFBBHLast;
Comments and code removed
-
Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*
Correct spelling / typo wit = with in the Bitcoingui.cpp :: commit
Correct spelling / typo wit = with in the Bitcoingui.cpp connector menu
https://github.com/FeatherCoin/Feathercoin/commit/acb5abcbbeac0cec38fe9665f364900704d01f60
src/qt/bitcoingui.cpp
+ coinnectorAction->setStatusTip(tr("Exchange other coins with your feathercoin on Coinnector"));
Needs review against Translation database.
-
Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*
ScanHash_CryptoPP unused function remove :: commit
ScanHash_CryptoPP unused function removed from miner.cpp
https://github.com/FeatherCoin/Feathercoin/commit/2ac641ec011faf29f669f8b1e8449ef7e94b2af2
src/miner.cpp
+// ScanHash_CryptoPP not used +//unsigned int static ScanHash_CryptoPP(char* pmidstate, char* pdata, char* phash1, char* phash, unsigned int& nHashesDone) +//{ +// unsigned int& nNonce = *(unsigned int*)(pdata + 12); +// for (;;) +// { +// // Crypto++ SHA256 +// // Hash pdata using pmidstate as the starting state into +// // pre-formatted buffer phash1, then hash phash1 into phash +// nNonce++;
Start of code which is commented out, so can be put back
-
Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*
Hash out deprecated autoconfig and add autoupdate t :: commit
Hash out deprecated autoconfig and add autoupdate to stop build warnings
https://github.com/FeatherCoin/Feathercoin/commit/0edb5929d63efc16c7b3c599732173243ea01e9d
-autoreconf -if --warnings=all +# autoreconf -if --warnings=all
Minor update
-
Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*
Removed an unused variable sw :: commit
https://github.com/FeatherCoin/Feathercoin/commit/9a7b663c75fcc443d9118df0db9c6105760982db
src/qt/coinnectordialog.cpp
+// int sw=0;
Code commented out
-
Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*
Re-included autoreconf in ./autogen.sh :: commit
Re-included autoreconf in ./autogen.sh, included echo messages autoupdate is running
https://github.com/FeatherCoin/Feathercoin/commit/fdc52bc1c0e366f30c2c3f80af9128dcd556fdb1
-# autoreconf -if --warnings=all +echo running autoreconf ..... +autoreconf -if --warnings=all autoupdate +echo +echo running autoupdate completed .....
Code replaced