dash-docs/en/doxygen/html/pow_8h_source.html

123 lines
16 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Dash Core: src/pow.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(initResizable);
/* @license-end */</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="bitcoin_logo_doxygen.png"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Dash Core
&#160;<span id="projectnumber">0.12.2.1</span>
</div>
<div id="projectbrief">P2P Digital Currency</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('pow_8h_source.html','');});
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle">
<div class="title">pow.h</div> </div>
</div><!--header-->
<div class="contents">
<a href="pow_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">// Copyright (c) 2009-2010 Satoshi Nakamoto</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment">// Copyright (c) 2009-2015 The Bitcoin Core developers</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment">// Distributed under the MIT software license, see the accompanying</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment">// file COPYING or http://www.opensource.org/licenses/mit-license.php.</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;</div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="preprocessor">#ifndef BITCOIN_POW_H</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="preprocessor">#define BITCOIN_POW_H</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;</div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="params_8h.html">consensus/params.h</a>&quot;</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;</div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="preprocessor">#include &lt;stdint.h&gt;</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;</div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="keyword">class </span><a class="code" href="classCBlockHeader.html">CBlockHeader</a>;</div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="keyword">class </span><a class="code" href="classCBlockIndex.html">CBlockIndex</a>;</div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="keyword">class </span><a class="code" href="classuint256.html">uint256</a>;</div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="keyword">class </span><a class="code" href="classarith__uint256.html">arith_uint256</a>;</div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;</div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment">// Define difficulty retarget algorithms</span></div><div class="line"><a name="l00019"></a><span class="lineno"><a class="line" href="pow_8h.html#a8f131530ac35e565b56cfc1e857e5f02"> 19</a></span>&#160;<span class="keyword">enum</span> <a class="code" href="pow_8h.html#a8f131530ac35e565b56cfc1e857e5f02">DiffMode</a> {</div><div class="line"><a name="l00020"></a><span class="lineno"><a class="line" href="pow_8h.html#a8f131530ac35e565b56cfc1e857e5f02af99a307706bc56fe7605537d603d7e24"> 20</a></span>&#160; <a class="code" href="pow_8h.html#a8f131530ac35e565b56cfc1e857e5f02af99a307706bc56fe7605537d603d7e24">DIFF_DEFAULT</a> = 0, <span class="comment">// Default to invalid 0</span></div><div class="line"><a name="l00021"></a><span class="lineno"><a class="line" href="pow_8h.html#a8f131530ac35e565b56cfc1e857e5f02a135929a05c72016124855105d3d24851"> 21</a></span>&#160; <a class="code" href="pow_8h.html#a8f131530ac35e565b56cfc1e857e5f02a135929a05c72016124855105d3d24851">DIFF_BTC</a> = 1, <span class="comment">// Retarget every x blocks (Bitcoin style)</span></div><div class="line"><a name="l00022"></a><span class="lineno"><a class="line" href="pow_8h.html#a8f131530ac35e565b56cfc1e857e5f02a989bf0976493af2171e71c38be869c98"> 22</a></span>&#160; <a class="code" href="pow_8h.html#a8f131530ac35e565b56cfc1e857e5f02a989bf0976493af2171e71c38be869c98">DIFF_KGW</a> = 2, <span class="comment">// Retarget using Kimoto Gravity Well</span></div><div class="line"><a name="l00023"></a><span class="lineno"><a class="line" href="pow_8h.html#a8f131530ac35e565b56cfc1e857e5f02a31825da354804760c6916ecfed7a586a"> 23</a></span>&#160; <a class="code" href="pow_8h.html#a8f131530ac35e565b56cfc1e857e5f02a31825da354804760c6916ecfed7a586a">DIFF_DGW</a> = 3, <span class="comment">// Retarget using Dark Gravity Wave v3</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;};</div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="pow_8h.html#a4f7bb22f6a188117b401966decb048b5">GetNextWorkRequired</a>(<span class="keyword">const</span> <a class="code" href="classCBlockIndex.html">CBlockIndex</a>* pindexLast, <span class="keyword">const</span> <a class="code" href="classCBlockHeader.html">CBlockHeader</a> *pblock, <span class="keyword">const</span> <a class="code" href="structConsensus_1_1Params.html">Consensus::Params</a>&amp;);</div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="pow_8h.html#ae040e051ee33e04c33124b0742480f0c">CalculateNextWorkRequired</a>(<span class="keyword">const</span> <a class="code" href="classCBlockIndex.html">CBlockIndex</a>* pindexLast, int64_t nFirstBlockTime, <span class="keyword">const</span> <a class="code" href="structConsensus_1_1Params.html">Consensus::Params</a>&amp;);</div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;</div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;</div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="keywordtype">bool</span> <a class="code" href="pow_8h.html#a8d60d8d6ddca0963bb51f6436aaee3fd">CheckProofOfWork</a>(<a class="code" href="classuint256.html">uint256</a> hash, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> nBits, <span class="keyword">const</span> <a class="code" href="structConsensus_1_1Params.html">Consensus::Params</a>&amp;);</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<a class="code" href="classarith__uint256.html">arith_uint256</a> <a class="code" href="pow_8h.html#a334aa8015cc7185f7fdf484783e40f38">GetBlockProof</a>(<span class="keyword">const</span> <a class="code" href="classCBlockIndex.html">CBlockIndex</a>&amp; block);</div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;</div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;int64_t <a class="code" href="pow_8h.html#a6f922f61b23b0fc46182f8ab457af736">GetBlockProofEquivalentTime</a>(<span class="keyword">const</span> <a class="code" href="classCBlockIndex.html">CBlockIndex</a>&amp; to, <span class="keyword">const</span> <a class="code" href="classCBlockIndex.html">CBlockIndex</a>&amp; from, <span class="keyword">const</span> <a class="code" href="classCBlockIndex.html">CBlockIndex</a>&amp; tip, <span class="keyword">const</span> <a class="code" href="structConsensus_1_1Params.html">Consensus::Params</a>&amp;);</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;<span class="preprocessor">#endif // BITCOIN_POW_H</span></div><div class="ttc" id="pow_8h_html_a4f7bb22f6a188117b401966decb048b5"><div class="ttname"><a href="pow_8h.html#a4f7bb22f6a188117b401966decb048b5">GetNextWorkRequired</a></div><div class="ttdeci">unsigned int GetNextWorkRequired(const CBlockIndex *pindexLast, const CBlockHeader *pblock, const Consensus::Params &amp;)</div><div class="ttdef"><b>Definition:</b> <a href="pow_8cpp_source.html#l00172">pow.cpp:172</a></div></div>
<div class="ttc" id="pow_8h_html_a8f131530ac35e565b56cfc1e857e5f02"><div class="ttname"><a href="pow_8h.html#a8f131530ac35e565b56cfc1e857e5f02">DiffMode</a></div><div class="ttdeci">DiffMode</div><div class="ttdef"><b>Definition:</b> <a href="pow_8h_source.html#l00019">pow.h:19</a></div></div>
<div class="ttc" id="pow_8h_html_a8f131530ac35e565b56cfc1e857e5f02af99a307706bc56fe7605537d603d7e24"><div class="ttname"><a href="pow_8h.html#a8f131530ac35e565b56cfc1e857e5f02af99a307706bc56fe7605537d603d7e24">DIFF_DEFAULT</a></div><div class="ttdef"><b>Definition:</b> <a href="pow_8h_source.html#l00020">pow.h:20</a></div></div>
<div class="ttc" id="pow_8h_html_a8f131530ac35e565b56cfc1e857e5f02a31825da354804760c6916ecfed7a586a"><div class="ttname"><a href="pow_8h.html#a8f131530ac35e565b56cfc1e857e5f02a31825da354804760c6916ecfed7a586a">DIFF_DGW</a></div><div class="ttdef"><b>Definition:</b> <a href="pow_8h_source.html#l00023">pow.h:23</a></div></div>
<div class="ttc" id="pow_8h_html_a8f131530ac35e565b56cfc1e857e5f02a135929a05c72016124855105d3d24851"><div class="ttname"><a href="pow_8h.html#a8f131530ac35e565b56cfc1e857e5f02a135929a05c72016124855105d3d24851">DIFF_BTC</a></div><div class="ttdef"><b>Definition:</b> <a href="pow_8h_source.html#l00021">pow.h:21</a></div></div>
<div class="ttc" id="structConsensus_1_1Params_html"><div class="ttname"><a href="structConsensus_1_1Params.html">Consensus::Params</a></div><div class="ttdef"><b>Definition:</b> <a href="params_8h_source.html#l00043">params.h:43</a></div></div>
<div class="ttc" id="pow_8h_html_ae040e051ee33e04c33124b0742480f0c"><div class="ttname"><a href="pow_8h.html#ae040e051ee33e04c33124b0742480f0c">CalculateNextWorkRequired</a></div><div class="ttdeci">unsigned int CalculateNextWorkRequired(const CBlockIndex *pindexLast, int64_t nFirstBlockTime, const Consensus::Params &amp;)</div><div class="ttdef"><b>Definition:</b> <a href="pow_8cpp_source.html#l00204">pow.cpp:204</a></div></div>
<div class="ttc" id="params_8h_html"><div class="ttname"><a href="params_8h.html">params.h</a></div></div>
<div class="ttc" id="pow_8h_html_a334aa8015cc7185f7fdf484783e40f38"><div class="ttname"><a href="pow_8h.html#a334aa8015cc7185f7fdf484783e40f38">GetBlockProof</a></div><div class="ttdeci">arith_uint256 GetBlockProof(const CBlockIndex &amp;block)</div><div class="ttdef"><b>Definition:</b> <a href="pow_8cpp_source.html#l00257">pow.cpp:257</a></div></div>
<div class="ttc" id="pow_8h_html_a8d60d8d6ddca0963bb51f6436aaee3fd"><div class="ttname"><a href="pow_8h.html#a8d60d8d6ddca0963bb51f6436aaee3fd">CheckProofOfWork</a></div><div class="ttdeci">bool CheckProofOfWork(uint256 hash, unsigned int nBits, const Consensus::Params &amp;)</div><div class="ttdef"><b>Definition:</b> <a href="pow_8cpp_source.html#l00238">pow.cpp:238</a></div></div>
<div class="ttc" id="classarith__uint256_html"><div class="ttname"><a href="classarith__uint256.html">arith_uint256</a></div><div class="ttdef"><b>Definition:</b> <a href="arith__uint256_8h_source.html#l00253">arith_uint256.h:253</a></div></div>
<div class="ttc" id="classuint256_html"><div class="ttname"><a href="classuint256.html">uint256</a></div><div class="ttdef"><b>Definition:</b> <a href="uint256_8h_source.html#l00114">uint256.h:114</a></div></div>
<div class="ttc" id="classCBlockHeader_html"><div class="ttname"><a href="classCBlockHeader.html">CBlockHeader</a></div><div class="ttdef"><b>Definition:</b> <a href="block_8h_source.html#l00020">block.h:20</a></div></div>
<div class="ttc" id="pow_8h_html_a6f922f61b23b0fc46182f8ab457af736"><div class="ttname"><a href="pow_8h.html#a6f922f61b23b0fc46182f8ab457af736">GetBlockProofEquivalentTime</a></div><div class="ttdeci">int64_t GetBlockProofEquivalentTime(const CBlockIndex &amp;to, const CBlockIndex &amp;from, const CBlockIndex &amp;tip, const Consensus::Params &amp;)</div><div class="ttdef"><b>Definition:</b> <a href="pow_8cpp_source.html#l00272">pow.cpp:272</a></div></div>
<div class="ttc" id="pow_8h_html_a8f131530ac35e565b56cfc1e857e5f02a989bf0976493af2171e71c38be869c98"><div class="ttname"><a href="pow_8h.html#a8f131530ac35e565b56cfc1e857e5f02a989bf0976493af2171e71c38be869c98">DIFF_KGW</a></div><div class="ttdef"><b>Definition:</b> <a href="pow_8h_source.html#l00022">pow.h:22</a></div></div>
<div class="ttc" id="classCBlockIndex_html"><div class="ttname"><a href="classCBlockIndex.html">CBlockIndex</a></div><div class="ttdef"><b>Definition:</b> <a href="chain_8h_source.html#l00100">chain.h:100</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="pow_8h.html">pow.h</a></li>
<li class="footer">Generated on Thu Dec 14 2017 13:15:04 for Dash Core by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.14 </li>
</ul>
</div>
</body>
</html>