[Dev] Documenting Feathercoin Specific Software settings - Part 13
-
Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*
Set COINBASE_MATURITY to 100 :: commit
https://github.com/FeatherCoin/Feathercoin/commit/d8d8e80e98e2f1af09a7c15293368972fb2ed43c
src/main.cpp
+int CMerkleTx::GetHeightInMainChain(CBlockIndex* &pindexRet) const +{ + return chainActive.Height() - GetDepthInMainChain(pindexRet) + 1; +} +
Code added
- return max(0, (COINBASE_MATURITY+1) - GetDepthInMainChain());
Code removed
+ + int nHeight = GetHeightInMainChain(); + int nMaturity = GetRequiredMaturityDepth(nHeight); + + //return max(0, (COINBASE_MATURITY+1) - GetDepthInMainChain()); + return max(0, (nMaturity+20) - GetDepthInMainChain());
Code replaced, commented out …
- if (nSpendHeight - coins.nHeight < COINBASE_MATURITY)
Code removed
+ + int minDepth = GetRequiredMaturityDepth(coins.nHeight); + //if (nSpendHeight - coins.nHeight < COINBASE_MATURITY) + if (nSpendHeight - coins.nHeight < minDepth)
Code replaced commented out.
-
Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*
Set COINBASE_MATURITY to 100 :: commit
https://github.com/FeatherCoin/Feathercoin/commit/d8d8e80e98e2f1af09a7c15293368972fb2ed43c
src/main.h
/** Coinbase transaction outputs can only be spent after this number of new blocks (network rule) */ static const int COINBASE_MATURITY = 30; /** Coinbase maturity after block 145000 **/ -static const int COINBASE_MATURITY_NEW = 60*4; +static const int COINBASE_MATURITY_NEW = BASE_MATURITY; /** Block at which COINBASE_MATURITY_NEW comes into effect **/ -static const int COINBASE_MATURITY_SWITCH = 145000; +static const int COINBASE_MATURITY_SWITCH = 1180000; /** Threshold for nLockTime: below this value it is interpreted as block number, otherwise as UNIX timestamp. */ static const unsigned int LOCKTIME_THRESHOLD = 500000000; // Tue Nov 5 00:53:20 1985 UTC /** Maximum number of script-checking threads allowed */
Code replaced
+ int GetHeightInMainChain(CBlockIndex* &pindexRet) const; + int GetHeightInMainChain() const { CBlockIndex *pindexRet; return GetHeightInMainChain(pindexRet); }
Code added
-
Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*
Set COINBASE_MATURITY to 100 :: commit
https://github.com/FeatherCoin/Feathercoin/commit/d8d8e80e98e2f1af09a7c15293368972fb2ed43c
src/qt/transactiondesc.cpp
+ if (wtx.GetDepthInMainChain() >= COINBASE_MATURITY_SWITCH) + { + numBlocksToMaturity = COINBASE_MATURITY_NEW + 1; + } strHTML += "<br>" + tr("Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to \"not accepted\" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.").arg(QString::number(numBlocksToMaturity)) + "<br>";
Code added
-
Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*
Set COINBASE_MATURITY to 100 – Part 2 :: commit
https://github.com/FeatherCoin/Feathercoin/commit/13fa1b1e711a9eb610b90f80a3c18920b9398eee
src/main.h
-/** Coinbase maturity after block 145000 **/ +/** Coinbase maturity after block 1180000 **/
Comment replaced
-
Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*
Accept blocks version 4 :: commit
https://github.com/FeatherCoin/Feathercoin/commit/911098d4b9124ff01406729efc345a4dbbff6d68
src/main.cpp
- if(block.nVersion != 2) + if(block.nVersion < 2)
Code replaced, note updated lalter
-
Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*
Changed client string from Satoshi to Feathercoin :: commit
https://github.com/FeatherCoin/Feathercoin/commit/911098d4b9124ff01406729efc345a4dbbff6d68
src/main.cpp
// Name of client reported in the 'version' message. Report the same name // for both bitcoind and bitcoin-qt, to make it harder for attackers to // target servers or GUI users specifically. -const std::string CLIENT_NAME("Satoshi"); +const std::string CLIENT_NAME("Feathercoin");
Code replaced
-
Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*
patch for boost 1.58 :: commit
https://github.com/FeatherCoin/Feathercoin/commit/5601b413231102e2e0cd7e541bbd3eabf98ed14c
src/rpcrawtransaction.cpp
+#include <boost/version.hpp>
Code added
- const CScriptID& hash = boost::get<const CScriptID&>(address);
Code removed
+#if ((BOOST_VERSION / 100000 == 1) && (BOOST_VERSION / 100 % 1000 == 58)) + const qCScriptID& hash = boost::get<const CScriptID>(address); +#else + const CScriptID& hash = boost::get<const CScriptID&>(address); +#endif
Code (was) replaced
-
Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*
Patch for boost 1.58 Part 2 :: commit
https://github.com/FeatherCoin/Feathercoin/commit/cd24671468cc5406b9e3fb1fa2068bb0cbc93360
src/rpcrawtransaction.cpp
+#warning BOOST_VERSION
Code added
-
Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*
fixed typo only :: commit
https://github.com/FeatherCoin/Feathercoin/commit/1a0c9349ef27c7d5e748de6e8710fcec4a700be2
src/rpcrawtransaction.cpp
- const qCScriptID& hash = boost::get<const CScriptID>(address); + const CScriptID& hash = boost::get<const CScriptID>(address);
Code replaced
-
Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*
warning base40.h :: commit
https://github.com/FeatherCoin/Feathercoin/commit/31de18a9af359ee00273e68740e161e7c1a48c88
src/base40.h
-static const char* pszBase16 = "0123456789abcdef"; - if (val < 0) return "ERROR";
Code removed
+#endif // FEATHERCOIN_BASE40_H
-
Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*
Version bump to 0.9.3.2 :: commit
https://github.com/FeatherCoin/Feathercoin/commit/103dd1db969c1103c5d56e52aa3b95b0868d8575
src/base40.h
define(_CLIENT_VERSION_MAJOR, 0) define(_CLIENT_VERSION_MINOR, 9) define(_CLIENT_VERSION_REVISION, 3) -define(_CLIENT_VERSION_BUILD, 1) +define(_CLIENT_VERSION_BUILD, 2) define(_CLIENT_VERSION_IS_RELEASE, true) -define(_COPYRIGHT_YEAR, 2014) +define(_COPYRIGHT_YEAR, 2016)
Code replaced
-
Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*
Update configure.ac :: commit
https://github.com/FeatherCoin/Feathercoin/commit/533cc56c45feef9583544e03a688d29bd191b19a
-define(_CLIENT_VERSION_IS_RELEASE, true) +define(_CLIENT_VERSION_IS_RELEASE, false)
Code replaced
-
Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*
Accept blocks version 4 — Part 2 :: commit
src/main.cpp
+ CBlockIndex *pindex = chainActive.Tip(); + LogPrintf("SetBestChain: chainActive nHeight=%d,BlockHash=%s\n",pindex->nHeight,pindex->GetBlockHash().ToString()); + LogPrintf("SetBestChain: pindexNew nHeight=%d,BlockHash=%s,pprev nHeight=%d,BlockHash=%s\n",pindexNew->nHeight,pindexNew->GetBlockHash().ToString(),pindexNew->pprev->nHeight,pindexNew->pprev->GetBlockHash().ToString()); + + if ((pindex->nHeight +1)!=pindexNew->nHeight) + return true; + + LogPrintf("SetBestChain: pindexNew go.\n"); + + if (!ConnectTip(state,pindexNew)) + { + LogPrintf("SetBestChain: false.\n"); + return false; + } + + LogPrintf("SetBestChain: true.\n");
Code added
- if(block.nVersion < 2) + if ((block.nVersion !=2)&&(block.nVersion !=4)) + { + LogPrintf("AcceptBlockHeader,incorrect block version=%d \n",block.nVersion); + }
Code replaced, note this has been updated further