diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fc8d58d97d..0766d89f55 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -130,7 +130,7 @@ pull requests which attempt to do too much, are overly large, or overly complex as this makes review difficult. -###Features +### Features When adding a new feature, thought must be given to the long term technical debt and maintenance that feature may require after inclusion. Before proposing a new @@ -139,7 +139,7 @@ maintain it (including bug fixing). If features get orphaned with no maintainer in the future, they may be removed by the Repository Maintainer. -###Refactoring +### Refactoring Refactoring is a necessary part of any software project's evolution. The following guidelines cover refactoring pull requests for the project. @@ -187,7 +187,7 @@ other kinds of patches because of increased peer review and consensus building requirements. -###Peer Review +### Peer Review Anyone may participate in peer review which is expressed by comments in the pull request. Typically reviewers will review the code for obvious errors, as well as diff --git a/contrib/gitian-keys/oharareidryan-key.asc b/contrib/gitian-keys/oharareidryan-key.asc new file mode 100644 index 0000000000..2c83a8e853 --- /dev/null +++ b/contrib/gitian-keys/oharareidryan-key.asc @@ -0,0 +1,52 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1 + +mQINBFjCAtkBEADKSVwMdoPzhEoZocADNvVxkD3FHktkwy0CJzqfjxB8yr0vrppL +v9jta/xvb0eg58BXkxX3wkJ9o4XUEUqxwH4GLuvL4aDlbQbLgxxQ1PaQNhKTkVAh +2NG8cRX6BPqy46appqZTbK2oU5xkV6OCQZ4xEdBD2fRHE4ndfZIrzAbHRgl7c7eO +VXXh5GEjuMKeK8sOx9/KtBf0rqBdugEihoXojVmQJf/J7KmiKu1u6vLd3vnw/xnQ +OADUoMyWEu07l1dSPEIEQ0/Tdzkwk13QNcpAXBptl6cupt5c6D96mzMD+qYn105H +IN2QvSSol0Vx1uQ5qSVGE1oxu9kVZNpbtrNUSRc6DhAwGuzA5jRo2mjN5KATvEOo +NdOXfXgATMKsTikYwMulSgSFruJJAMKBiGSnf2hzPbMxxybFYHTnD5zA2XP6Xi9f +2EusrYAdlit86py1z1jZCIX1Woo6H+8d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Taeeqvqpo3BbKy +4VmM4s323w8ViqB5IQjip/J8JA+YlG+sI1IsuZbuEvs4mb4DBHbQZyxgAp5Pwlni +B/SrbDNjAWRmTr7L3H5PxKsIxV+ARYS6p5vSptxxotViEQlKcSL4flxeg4W6RhBz +uKdSXlw32rxYA9ejel1Gm8wwUqRqb24Ntpw0ky1C4MTPV8shAYPlwZSm4YjHQ6xi +ac/mIDCXy2ESnwKWJGK8YMxIPWiqy36khN6qFzd8eZ/8T8y+3KBT561h4bt4UoUQ +aL6zFmltW6Ac/Wcz0/GX2BwOjozlbZQjba1ku6r7JBB/Z++xyCAw1NlhJuKGr5Ii +L3GQhtqZb+1qxg== +=/Urh +-----END PGP PUBLIC KEY BLOCK----- diff --git a/doc/man/Makefile.am b/doc/man/Makefile.am index 08ff4d6ac1..95dc463dea 100644 --- a/doc/man/Makefile.am +++ b/doc/man/Makefile.am @@ -1,13 +1,13 @@ dist_man1_MANS= if BUILD_BITCOIND - dist_man1_MANS+=bitcoind.1 + dist_man1_MANS+=litecoind.1 endif if ENABLE_QT - dist_man1_MANS+=bitcoin-qt.1 + dist_man1_MANS+=litecoin-qt.1 endif if BUILD_BITCOIN_UTILS - dist_man1_MANS+=bitcoin-cli.1 bitcoin-tx.1 + dist_man1_MANS+=litecoin-cli.1 litecoin-tx.1 endif diff --git a/doc/man/bitcoin-cli.1 b/doc/man/litecoin-cli.1 similarity index 64% rename from doc/man/bitcoin-cli.1 rename to doc/man/litecoin-cli.1 index 77ee12f04a..0df57c2a43 100644 --- a/doc/man/bitcoin-cli.1 +++ b/doc/man/litecoin-cli.1 @@ -1,17 +1,17 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.3. -.TH BITCOIN-CLI "1" "June 2017" "bitcoin-cli v0.14.2.0" "User Commands" +.TH LITECOIN-CLI "1" "June 2017" "litecoin-cli v0.14.2.0" "User Commands" .SH NAME -bitcoin-cli \- manual page for bitcoin-cli v0.14.2.0 +litecoin-cli \- manual page for litecoin-cli v0.14.2.0 .SH DESCRIPTION -Bitcoin Core RPC client version v0.14.2.0 +Litecoin Core RPC client version v0.14.2.0 .SS "Usage:" .TP -bitcoin\-cli [options] [params] -Send command to Bitcoin Core +litecoin\-cli [options] [params] +Send command to Litecoin Core .IP -bitcoin\-cli [options] \fB\-named\fR [name=value] ... Send command to Bitcoin Core (with named arguments) -bitcoin\-cli [options] help List commands -bitcoin\-cli [options] help Get help for a command +litecoin\-cli [options] \fB\-named\fR [name=value] ... Send command to Litecoin Core (with named arguments) +litecoin\-cli [options] help List commands +litecoin\-cli [options] help Get help for a command .SH OPTIONS .HP \-? @@ -20,7 +20,7 @@ This help message .HP \fB\-conf=\fR .IP -Specify configuration file (default: bitcoin.conf) +Specify configuration file (default: litecoin.conf) .HP \fB\-datadir=\fR .IP @@ -48,7 +48,7 @@ Send commands to node running on (default: 127.0.0.1) .HP \fB\-rpcport=\fR .IP -Connect to JSON\-RPC on (default: 8332 or testnet: 18332) +Connect to JSON\-RPC on (default: 9332 or testnet: 19332) .HP \fB\-rpcwait\fR .IP @@ -72,10 +72,11 @@ Read extra arguments from standard input, one per line until EOF/Ctrl\-D (recommended for sensitive information such as passphrases) .SH COPYRIGHT Copyright (C) 2009-2017 The Bitcoin Core developers +Copyright (C) 2011-2017 The Litecoin Core developers -Please contribute if you find Bitcoin Core useful. Visit - for further information about the software. -The source code is available from . +Please contribute if you find Litecoin Core useful. Visit + for further information about the software. +The source code is available from . This is experimental software. Distributed under the MIT software license, see the accompanying file COPYING diff --git a/doc/man/bitcoin-qt.1 b/doc/man/litecoin-qt.1 similarity index 90% rename from doc/man/bitcoin-qt.1 rename to doc/man/litecoin-qt.1 index a51d4f6316..463f947380 100644 --- a/doc/man/bitcoin-qt.1 +++ b/doc/man/litecoin-qt.1 @@ -1,12 +1,12 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.3. -.TH BITCOIN-QT "1" "June 2017" "bitcoin-qt v0.14.2.0" "User Commands" +.TH LITECOIN-QT "1" "June 2017" "litecoin-qt v0.14.2.0" "User Commands" .SH NAME -bitcoin-qt \- manual page for bitcoin-qt v0.14.2.0 +litecoin-qt \- manual page for litecoin-qt v0.14.2.0 .SH DESCRIPTION -Bitcoin Core version v0.14.2.0 (64\-bit) +Litecoin Core version v0.14.2.0 (64\-bit) Usage: .IP -bitcoin\-qt [command\-line options] +litecoin\-qt [command\-line options] .SH OPTIONS .HP \-? @@ -32,13 +32,13 @@ block hash) If this block is in the chain assume that it and its ancestors are valid and potentially skip their script verification (0 to verify all, default: -00000000000000000013176bf8d7dfeab4e1db31dc93bc311b436e82ab226b90, +1673fa904a93848eca83d5ca82c7af974511a7e640e22edc2976420744f2e56a, testnet: -00000000000128796ee387cf110ccb9d2f36cffaf7f73079c995377c65ac0dcc) +43a16a626ef2ffdbe928f2bc26dcd5475c6a1a04f9542dfc6a0a88e5fcf9bd4c) .HP \fB\-conf=\fR .IP -Specify configuration file (default: bitcoin.conf) +Specify configuration file (default: litecoin.conf) .HP \fB\-datadir=\fR .IP @@ -58,7 +58,7 @@ Keep at most unconnectable transactions in memory (default: 100) .HP \fB\-maxmempool=\fR .IP -Keep the transaction memory pool below megabytes (default: 300) +Keep the transaction memory pool below megabytes (default: 5) .HP \fB\-mempoolexpiry=\fR .IP @@ -77,7 +77,7 @@ leave that many cores free, default: 0) .HP \fB\-pid=\fR .IP -Specify pid file (default: bitcoind.pid) +Specify pid file (default: litecoind.pid) .HP \fB\-prune=\fR .IP @@ -280,17 +280,17 @@ Set key pool size to (default: 100) .HP \fB\-fallbackfee=\fR .IP -A fee rate (in BTC/kB) that will be used when fee estimation has -insufficient data (default: 0.0002) +A fee rate (in LTC/kB) that will be used when fee estimation has +insufficient data (default: 0.002) .HP \fB\-mintxfee=\fR .IP -Fees (in BTC/kB) smaller than this are considered zero fee for -transaction creation (default: 0.00001) +Fees (in LTC/kB) smaller than this are considered zero fee for +transaction creation (default: 0.001) .HP \fB\-paytxfee=\fR .IP -Fee (in BTC/kB) to add to transactions you send (default: 0.00) +Fee (in LTC/kB) to add to transactions you send (default: 0.00) .HP \fB\-rescan\fR .IP @@ -389,12 +389,12 @@ Prepend debug output with timestamp (default: 1) .HP \fB\-minrelaytxfee=\fR .IP -Fees (in BTC/kB) smaller than this are considered zero fee for relaying, -mining and transaction creation (default: 0.00001) +Fees (in LTC/kB) smaller than this are considered zero fee for relaying, +mining and transaction creation (default: 0.001) .HP \fB\-maxtxfee=\fR .IP -Maximum total fees (in BTC) to use in a single wallet transaction or raw +Maximum total fees (in LTC) to use in a single wallet transaction or raw transaction; setting this too low may abort large transactions (default: 0.10) .HP @@ -449,7 +449,7 @@ Set maximum size of high\-priority/low\-fee transactions in bytes .HP \fB\-blockmintxfee=\fR .IP -Set lowest fee rate (in BTC/kB) for transactions to be included in block +Set lowest fee rate (in LTC/kB) for transactions to be included in block creation. (default: 0.00001) .PP RPC server options: @@ -491,8 +491,8 @@ option can be specified multiple times .HP \fB\-rpcport=\fR .IP -Listen for JSON\-RPC connections on (default: 8332 or testnet: -18332) +Listen for JSON\-RPC connections on (default: 9332 or testnet: +19332) .HP \fB\-rpcallowip=\fR .IP @@ -532,10 +532,11 @@ Show splash screen on startup (default: 1) Reset all settings changed in the GUI .SH COPYRIGHT Copyright (C) 2009-2017 The Bitcoin Core developers +Copyright (C) 2011-2017 The Litecoin Core developers -Please contribute if you find Bitcoin Core useful. Visit - for further information about the software. -The source code is available from . +Please contribute if you find Litecoin Core useful. Visit + for further information about the software. +The source code is available from . This is experimental software. Distributed under the MIT software license, see the accompanying file COPYING diff --git a/doc/man/bitcoin-tx.1 b/doc/man/litecoin-tx.1 similarity index 80% rename from doc/man/bitcoin-tx.1 rename to doc/man/litecoin-tx.1 index 04ec7b9553..b14fdf4470 100644 --- a/doc/man/bitcoin-tx.1 +++ b/doc/man/litecoin-tx.1 @@ -1,16 +1,16 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.3. -.TH BITCOIN-TX "1" "June 2017" "bitcoin-tx v0.14.2.0" "User Commands" +.TH LITECOIN-TX "1" "June 2017" "litecoin-tx v0.14.2.0" "User Commands" .SH NAME -bitcoin-tx \- manual page for bitcoin-tx v0.14.2.0 +litecoin-tx \- manual page for litecoin-tx v0.14.2.0 .SH DESCRIPTION -Bitcoin Core bitcoin\-tx utility version v0.14.2.0 +Litecoin Core litecoin\-tx utility version v0.14.2.0 .SS "Usage:" .TP -bitcoin\-tx [options] [commands] -Update hex\-encoded bitcoin transaction +litecoin\-tx [options] [commands] +Update hex\-encoded litecoin transaction .TP -bitcoin\-tx [options] \fB\-create\fR [commands] -Create hex\-encoded bitcoin transaction +litecoin\-tx [options] \fB\-create\fR [commands] +Create hex\-encoded litecoin transaction .SH OPTIONS .HP \-? @@ -108,10 +108,11 @@ set=NAME:JSON\-STRING Set register NAME to given JSON\-STRING .SH COPYRIGHT Copyright (C) 2009-2017 The Bitcoin Core developers +Copyright (C) 2011-2017 The Litecoin Core developers -Please contribute if you find Bitcoin Core useful. Visit - for further information about the software. -The source code is available from . +Please contribute if you find Litecoin Core useful. Visit + for further information about the software. +The source code is available from . This is experimental software. Distributed under the MIT software license, see the accompanying file COPYING diff --git a/doc/man/bitcoind.1 b/doc/man/litecoind.1 similarity index 90% rename from doc/man/bitcoind.1 rename to doc/man/litecoind.1 index b3d8e0b9a3..9da17a8515 100644 --- a/doc/man/bitcoind.1 +++ b/doc/man/litecoind.1 @@ -1,13 +1,13 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.3. -.TH BITCOIND "1" "June 2017" "bitcoind v0.14.2.0" "User Commands" +.TH LITECOIND "1" "June 2017" "litecoind v0.14.2.0" "User Commands" .SH NAME -bitcoind \- manual page for bitcoind v0.14.2.0 +litecoind \- manual page for litecoind v0.14.2.0 .SH DESCRIPTION -Bitcoin Core Daemon version v0.14.2.0 +Litecoin Core Daemon version v0.14.2.0 .SS "Usage:" .TP -bitcoind [options] -Start Bitcoin Core Daemon +litecoind [options] +Start Litecoin Core Daemon .SH OPTIONS .HP \-? @@ -33,13 +33,13 @@ block hash) If this block is in the chain assume that it and its ancestors are valid and potentially skip their script verification (0 to verify all, default: -00000000000000000013176bf8d7dfeab4e1db31dc93bc311b436e82ab226b90, +1673fa904a93848eca83d5ca82c7af974511a7e640e22edc2976420744f2e56a, testnet: -00000000000128796ee387cf110ccb9d2f36cffaf7f73079c995377c65ac0dcc) +43a16a626ef2ffdbe928f2bc26dcd5475c6a1a04f9542dfc6a0a88e5fcf9bd4c) .HP \fB\-conf=\fR .IP -Specify configuration file (default: bitcoin.conf) +Specify configuration file (default: litecoin.conf) .HP \fB\-daemon\fR .IP @@ -63,7 +63,7 @@ Keep at most unconnectable transactions in memory (default: 100) .HP \fB\-maxmempool=\fR .IP -Keep the transaction memory pool below megabytes (default: 300) +Keep the transaction memory pool below megabytes (default: 5) .HP \fB\-mempoolexpiry=\fR .IP @@ -82,7 +82,7 @@ leave that many cores free, default: 0) .HP \fB\-pid=\fR .IP -Specify pid file (default: bitcoind.pid) +Specify pid file (default: litecoind.pid) .HP \fB\-prune=\fR .IP @@ -285,17 +285,17 @@ Set key pool size to (default: 100) .HP \fB\-fallbackfee=\fR .IP -A fee rate (in BTC/kB) that will be used when fee estimation has -insufficient data (default: 0.0002) +A fee rate (in LTC/kB) that will be used when fee estimation has +insufficient data (default: 0.002) .HP \fB\-mintxfee=\fR .IP -Fees (in BTC/kB) smaller than this are considered zero fee for -transaction creation (default: 0.00001) +Fees (in LTC/kB) smaller than this are considered zero fee for +transaction creation (default: 0.001) .HP \fB\-paytxfee=\fR .IP -Fee (in BTC/kB) to add to transactions you send (default: 0.00) +Fee (in LTC/kB) to add to transactions you send (default: 0.00) .HP \fB\-rescan\fR .IP @@ -394,12 +394,12 @@ Prepend debug output with timestamp (default: 1) .HP \fB\-minrelaytxfee=\fR .IP -Fees (in BTC/kB) smaller than this are considered zero fee for relaying, +Fees (in LTC/kB) smaller than this are considered zero fee for relaying, mining and transaction creation (default: 0.00001) .HP \fB\-maxtxfee=\fR .IP -Maximum total fees (in BTC) to use in a single wallet transaction or raw +Maximum total fees (in LTC) to use in a single wallet transaction or raw transaction; setting this too low may abort large transactions (default: 0.10) .HP @@ -454,7 +454,7 @@ Set maximum size of high\-priority/low\-fee transactions in bytes .HP \fB\-blockmintxfee=\fR .IP -Set lowest fee rate (in BTC/kB) for transactions to be included in block +Set lowest fee rate (in LTC/kB) for transactions to be included in block creation. (default: 0.00001) .PP RPC server options: @@ -496,8 +496,8 @@ option can be specified multiple times .HP \fB\-rpcport=\fR .IP -Listen for JSON\-RPC connections on (default: 8332 or testnet: -18332) +Listen for JSON\-RPC connections on (default: 9332 or testnet: +19332) .HP \fB\-rpcallowip=\fR .IP @@ -511,10 +511,11 @@ option can be specified multiple times Set the number of threads to service RPC calls (default: 4) .SH COPYRIGHT Copyright (C) 2009-2017 The Bitcoin Core developers +Copyright (C) 2011-2017 The Litecoin Core developers -Please contribute if you find Bitcoin Core useful. Visit - for further information about the software. -The source code is available from . +Please contribute if you find Litecoin Core useful. Visit + for further information about the software. +The source code is available from . This is experimental software. Distributed under the MIT software license, see the accompanying file COPYING diff --git a/src/bench/checkblock.cpp b/src/bench/checkblock.cpp index 230e4ca773..af0a3f9548 100644 --- a/src/bench/checkblock.cpp +++ b/src/bench/checkblock.cpp @@ -17,6 +17,9 @@ namespace block_bench { // a block off the wire, but before we can relay the block on to peers using // compact block relay. +// Litecoin uses block height 878439, hash 0babe680f55a55d54339511226755f0837261da89a4e78eba4d6436a63026df8 +// which contains 3808 transactions. + static void DeserializeBlockTest(benchmark::State& state) { CDataStream stream((const char*)block_bench::block413567, diff --git a/src/bench/data/block413567.raw b/src/bench/data/block413567.raw old mode 100644 new mode 100755 index 67d2d5d382..14938d4f25 Binary files a/src/bench/data/block413567.raw and b/src/bench/data/block413567.raw differ diff --git a/src/pow.cpp b/src/pow.cpp index fb724c01f9..4ecf272586 100644 --- a/src/pow.cpp +++ b/src/pow.cpp @@ -76,7 +76,8 @@ unsigned int CalculateNextWorkRequired(const CBlockIndex* pindexLast, int64_t nF bnNew.SetCompact(pindexLast->nBits); bnOld = bnNew; // Litecoin: intermediate uint256 can overflow by 1 bit - bool fShift = bnNew.bits() > 235; + const arith_uint256 bnPowLimit = UintToArith256(params.powLimit); + bool fShift = bnNew.bits() > bnPowLimit.bits() - 1; if (fShift) bnNew >>= 1; bnNew *= nActualTimespan; @@ -84,7 +85,6 @@ unsigned int CalculateNextWorkRequired(const CBlockIndex* pindexLast, int64_t nF if (fShift) bnNew <<= 1; - const arith_uint256 bnPowLimit = UintToArith256(params.powLimit); if (bnNew > bnPowLimit) bnNew = bnPowLimit;