aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Handle legacy v2 block at #66064Ross Nicoll2019-07-131-1/+3
|
* Correct PoW calculation logic to use locally calculated difficultyRoss Nicoll2019-07-131-3/+3
|
* Sync changes from Dogecoin 1.10Ross Nicoll2019-07-135-5/+38
|
* Merge AuxPoW support from NamecoreRoss Nicoll2019-07-1338-159/+1903
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes are as below: Wrap CBlockHeader::nVersion into a new class (CBlockVersion). This allows to take care of interpreting the field into a base version, auxpow flag and the chain ID. Update getauxblock.py for new 'generate' RPC call. Add 'auxpow' to block JSON. Accept auxpow as PoW verification. Add unit tests for auxpow verification. Add check for memory-layout of CBlockVersion. Weaken auxpow chain ID checks for the testnet. Allow Params() to overrule when to check the auxpow chain ID and for legacy blocks. Use this to disable the checks on testnet. Introduce CPureBlockHeader. Split the block header part that is used by auxpow and the "real" block header (that uses auxpow) to resolve the cyclic dependency between the two. Differentiate between uint256 and arith_uint256. This change was done upstream, modify the auxpow code. Add missing lock in auxpow_tests. Fix REST header check for auxpow headers. Those can be longer, thus take that into account. Also perform the check actually on an auxpow header. Correctly set the coinbase for getauxblock results. Call IncrementExtraNonce in getauxblock so that the coinbase is actually initialised with the stuff it should be. (BIP30 block height and COINBASE_FLAGS.) Implement getauxblock plus regression test. Turn auxpow test into FIXTURE test. This allows using of the Params() calls. Move CMerkleTx code to auxpow.cpp. Otherwise we get linker errors when building without wallet. Fix rebase with BIP66. Update the code to handle BIP66's nVersion=3. Enforce that auxpow parent blocks have no auxpow block version. This is for compatibility with namecoind. See also https://github.com/namecoin/namecoin/pull/199. Move auxpow-related parameters to Consensus::Params.
* Add Dogecoin difficulty calculationsRoss Nicoll2019-04-284-4/+157
|
* Correct build and test net seedRoss Nicoll2019-04-282-2/+2
| | | | | * Correct the test case from 100 blocks to 240 * Remove incorrect ", true" in testnet seed configuration
* Replace test data with Dogecoin valuesRoss Nicoll2019-04-0316-733/+748
| | | | | | | | | | | | | | | | | | | | Replace test data with Dogecoin equivalents in the folowing tests: * base58 * bip32 * keys * miner * pow * wallet Replace RPC and deterministic signatures in unit tests with Dogecoin values. While conventionally I'd use an alternative implementation for these, as RFC 6979 compliant signature generation isn't terribly common, and there's no reason to suspect we've modified this code, I'm going to assert that it's good enough to test that the code doesn't provide different values. Disabled Bitcoin PoW tests, but left code in place to simplify later merges. These are replaced by the Dogecoin PoW tests.
* Add Dogecoin block subsidy calculations.Ross Nicoll2019-04-037-2/+160
|
* Replace consensus values with Dogecoin equivalentsRoss Nicoll2019-04-0310-103/+120
| | | | | | | * Replace chain parameters with Dogecoin values * Update maximum coins to match Dogecoin * Disable version 2 block requirement * Update coinbase maturity to match Dogecoin
* Litecoin: Fix zeitgeist2 attack thanks to Lolcust and ArtForz. This fixes an ↵coblee2019-04-031-1/+7
| | | | issue where a 51% attack can change difficulty at will. Go back the full period unless it's the first retarget after genesis.
* Scrypt n=1024 PoW hashRoss Nicoll2019-04-0317-8/+517
| | | | | | Scrypt n=1024 PoW hash based upon Colin Percival's Tarnsnap (2009) Modified by Artforz, coblee, pooler, wtogami, Nikolay Belikov, Adrian Gallagher, Ross Nicoll
* Merge #14889: [0.17] Backport #14424 (Stop requiring imported pubkey to sign ↵Wladimir J. van der Laan2018-12-071-7/+7
|\ | | | | | | | | | | | | | | | | | | | | | | | | non-PKH schemes) 89a9a9d9385bbf291849874adc33a270b28fcac4 Stop requiring imported pubkey to sign non-PKH schemes (Pieter Wuille) Pull request description: Github-Pull: #14424 Rebased-From: 2f6b466aeb6d4c88ab2e0e8b2a402be0743608b5 Tree-SHA512: 1ea10dee66626f04918f197cd7c4949a836fa49c8f676f276b2328f8d79389059db7b30fc04d4c4bf8209f6a8d21f3ea49a017ddc7623eca6b7e6efc2fe0d749
| * Stop requiring imported pubkey to sign non-PKH schemesPieter Wuille2018-12-071-7/+7
| | | | | | | | | | Github-Pull: #14424 Rebased-From: 2f6b466aeb6d4c88ab2e0e8b2a402be0743608b5
* | Merge #14880: 0.17: Backport #14453MarcoFalke2018-12-061-8/+12
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dcb032dcdf qa: Ensure wallet unload during walletpassphrase timeout (João Barbosa) 75b5d8c4ea rpc: Fix wallet unload during walletpassphrase timeout (João Barbosa) Pull request description: Backport #14453 to 0.17 Tree-SHA512: fce0adccbb07b6635bb773a71beb4a9b814bceb77bbe7bbc5bcb7d151aabb1148c791622f58c990afe202012ca1971cd466cb536fc6f37e22cdc58738720b593
| * | rpc: Fix wallet unload during walletpassphrase timeoutJoão Barbosa2018-12-051-8/+12
| |/ | | | | | | | | Github-Pull: #14453 Rebased-From: 321decf
* / fix converttopsbt permitsigdata arg, add basic testGregory Sanders2018-12-051-1/+1
|/ | | | | Github-Pull: #14356 Rebased-From: 88a79cb436b30b39d37d139da723f5a31e9d161b
* Refactor PSBTInput signing to enforce invariantGlenn Willen2018-12-032-25/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactor the process of PSBTInput signing to enforce the invariant that a PSBTInput always has _either_ a witness_utxo or a non_witness_utxo, never both. This simplifies the logic of SignPSBTInput slightly, since it no longer has to deal with the "both" case. When calling it, we now give it, in order of preference: (1) whichever of the utxo fields was already present in the PSBT we received, or (2) if neither, the non_witness_utxo field, which is just a copy of the input transaction, which we get from the wallet. SignPSBTInput no longer has to remove one of the two fields; instead, it will check if we have a witness signature, and if so, it will replace the non_witness_utxo with the witness_utxo (which is smaller, as it is just a copy of the output being spent.) Add PSBTInput::IsSane checks in two more places, which checks for both utxo fields being present; we will now give an RPC error early on if we are supplied such a malformed PSBT to fill in. Also add a check to FillPSBT, to avoid touching any input that is already signed. (This is now redundant, since we should no longer potentially harm an already-signed input, but it's harmless.) fixes #14473 Github-Pull: #14588
* Simplify arguments to SignPSBTInputGlenn Willen2018-12-036-9/+10
| | | | | | | | | | | | Remove redundant arguments to SignPSBTInput -- since it needs several bits of the PartiallySignedTransaction, pass in a reference instead of doing it piecemeal. This saves us having to pass in both a PSBTInput and its index, as well as having to pass in the CTransaction. Also avoid redundantly passing the sighash_type, which is contained in the PSBTInput already. Github-Pull: #14588 Rebased-From: 0f5bda2bd941686620ef0eb90bd7ed973cc7ef73
* Add bool PSBTInputSignedGlenn Willen2018-12-033-4/+14
| | | | | | | | | | Refactor out a "PSBTInputSigned" function to check if a PSBT is signed, for use in subsequent commits. Also improve a related comment. GitHub-Pull: #14588 Rebased-From: 53e6fffb8f5b10f94708d33d667a67cb91c2d09d
* New PartiallySignedTransaction constructor from CTransctionGlenn Willen2018-12-033-8/+8
| | | | | | | | | New constructor that creates a PartiallySignedTransaction from a CTransaction, automatically sizing the inputs and outputs vectors for convenience. Github-Pull: #14588 Rebased-From: 65166d4cf828909dc4bc49dd68a58103d015f1fd
* Remove redundant txConst parameter to FillPSBTGlenn Willen2018-12-033-21/+9
| | | | | Github-Pull: #14588 Rebased-From: 4f3f5cb4b142f0fcb36241fa33b52a257901dbee
* More concise conversion of CDataStream to stringGlenn Willen2018-12-032-4/+4
| | | | | | | | Use .str() instead of .data() and .size() when converting CDataStream to a string. Uses std::string, avoiding conversion to a C string. Github-Pull: #14588 Rebased-From: fe5d22bc676f158e8d567d71edb3451118759d62
* check that a separator is found for psbt inputs, outputs, and global mapAndrew Chow2018-12-031-3/+27
| | | | | Github-Pull: #14377 Rebased-From: 4fb3388db95f408566e43ebb9736842cfbff0a7d
* Merge #14196: [0.17][psbt] always drop the unnecessary utxo and convert ↵MarcoFalke2018-12-011-2/+9
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | non-witness utxo to witness when necessary fcefc6851a Convert non-witness UTXOs to witness if witness sig created (Andrew Chow) fcdea8ad2a Drop the unnecessary UTXO based on the UTXOs present, not on earlier wallet things (Andrew Chow) Pull request description: When we sign an input in a psbt that has a non-witness utxo but a witness signature is produced, we will now replace the non-witness utxo with the corresponding witness utxo. Furthermore, we should make sure that the correct UTXO type is used based on what UTXOs are there, not based on earlier wallet behavior. Note that this is PR'd to the 0.17 branch because the code here no longer exists in master. Tree-SHA512: 882e9e4e9b77d6ac1743c35c0d59023aad6f4f19193398f97f2c6b81f6627d74e5220b1d674a0edba1ff2fc2a7f61afbf838d3faf0a964fccd3dee97c631aa47
| * Convert non-witness UTXOs to witness if witness sig createdAndrew Chow2018-09-111-0/+7
| | | | | | | | | | If a witness signature was created when a non-witness UTXO is used, convert the non-witness UTXO to a witness one.
| * Drop the unnecessary UTXO based on the UTXOs present, not on earlier wallet ↵Andrew Chow2018-09-111-2/+2
| | | | | | | | | | | | | | things Instead of dropping the unnecessary UTXO based on whether the wallet did something, do it based on whether two UTXOs are there.
* | CreateTransaction: Assume minimum p2sh-p2wpkh spend size for unknown changeGregory Sanders2018-11-303-1/+55
| |
* | Remove stale comment in CalculateMaximumSignedInputSizeGregory Sanders2018-11-301-2/+0
| |
* | Add SAFE_CHARS[SAFE_CHARS_URI]: Chars allowed in URIs (RFC 3986)practicalswift2018-11-293-1/+3
| | | | | | | | | | Github-Pull: #14618 Rebased-From: ab8c6f24d28ea1d1e6258cf316b4b97a0baf2377
* | rpc: Make HTTP RPC debug logging more informativepracticalswift2018-11-291-3/+7
| | | | | | | | | | Github-Pull: #14618 Rebased-From: 991248649b76a5a071e1360a700f3e2ecf3e1e1f
* | add test demonstrating addrLocal UBKaz Wesley2018-11-291-0/+38
| | | | | | | | | | Github-Pull: #14728 Rebased-From: 8ebbef016928811756e46b9086067d1c826797a8
* | fix uninitialized read when stringifying an addrLocalKaz Wesley2018-11-292-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Reachable from either place where SetIP is used when our best-guess addrLocal for a peer is IPv4, but the peer tells us it's reaching us at an IPv6 address. In that case, SetIP turns an IPv4 address into an IPv6 address without setting the scopeId, which is subsequently read in GetSockAddr during CNetAddr::ToStringIP and passed to getnameinfo. Fix by ensuring every constructor initializes the scopeId field with something. Github-Pull: #14728 Rebased-From: b7b36decaf878a8c1dcfdb4a27196c730043474b
* | Throw error if CPubKey is invalid during PSBT keypath serializationGregory Sanders2018-11-291-0/+3
| | | | | | | | | | Github-Pull: #14690 Rebased-From: 4e4de10f69d5d705256cadfb15d76314dff16e77
* | Bugfix: RPC: Add address_type named param for createmultisigLuke Dashjr2018-11-291-1/+1
| | | | | | | | | | Github-Pull: #14596 Rebased-From: d8bf1071cf819fb4e848bb832af8199f084e0434
* | Fix listreceivedbyaddress not taking address as a stringEric Scrivner2018-11-281-1/+0
| | | | | | | | | | | | | | Fixes #14173. Add the patch in #14173 and include a regression test. Github-Pull: #14417 Rebased-From: d4d70eda339f6f74390b56edd4021e928bb588a7
* | wallet: Avoid potential use of unitialized value bnb_used in ↵practicalswift2018-11-281-0/+2
| | | | | | | | | | | | | | CWallet::CreateTransaction(...) Github-Pull: #13546 Rebased-From: a23a7f60aa07de52d23ff1f2034fc43926ec3520
* | disallow oversized CBlockHeaderAndShortTxIDsKaz Wesley2018-11-281-0/+3
| | | | | | | | | | | | | | | | Otherwise we'd reply with a bogus BlockTransactionsRequest trying to request indexes with overflowed deltas. Github-Pull: #14685 Rebased-From: b08af10fb299dc3fdcd1f022619fb112c72e5d8e
* | fix a deserialization overflow edge caseKaz Wesley2018-11-281-3/+3
| | | | | | | | | | | | | | | | A specially-constructed BlockTransactionsRequest can overflow in deserialization in a way that is currently harmless. Github-Pull: #14685 Rebased-From: 6bed4b374daf26233e96fa7863d4324a5bfa99c2
* | add a test demonstrating an overflow in a deserialization edge caseKaz Wesley2018-11-281-0/+45
| | | | | | | | | | | | | | Also add a test that the highest legal index is accepted. Github-Pull: #14685 Rebased-From: 051faf7e9d4e32142f95f7adb31d2f53f656cb66
* | [wallet] Ensure wallet is unlocked before signinggustavonalle2018-11-281-0/+2
| | | | | | | | | | Github-Pull: #14310 Rebased-From: db15805668e923c3493d77122d20926496cf6a1a
* | Merge #14441: [wallet] Backport(0.17): Restore ability to list incoming ↵Wladimir J. van der Laan2018-11-101-8/+15
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | transactions by label 89306ab0df93bfdf5630910bc20b1eccb7379172 [wallet] Restore ability to list incoming transactions by label (Russell Yanofsky) Pull request description: Backport of PR #14411 to v0.17. This change partially reverts #13075 and #14023. Fixes #14382 Tree-SHA512: 1f8300e1a79e826cd706561265b8788deef505fa510be1a76ed9a62e5fca37cf6a741423ac0e5de2a36d6e8b9f25f141885455aacacbbf6474814e6eae406a27
| * | [wallet] Restore ability to list incoming transactions by labelRussell Yanofsky2018-10-101-8/+15
| | | | | | | | | | | | | | | | | | | | | | | | Backport of PR 14411 to v0.17. This change partially reverts #13075 and #14023. Fixes #14382
* | | qt: Revert "Force TLS1.0+ for SSL connections"Tim Ruffing2018-11-061-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 15e26a6a9afe299b9ca6fced73b876644365879b, whose purpose was to tweak the Qt configuration to force TLS, i.e., to disable SSLv3, in Qt versions >= 5.5. However, the default behavior of Qt >= 5.4 is to disable SSLv3 anyway [1], so the configuration tweak is redundant. With Qt 5.11.2, the configuration tweak is not only redundant but in fact provokes a deadlock (#14359) due to Qt 5.11.2 being incompatible with OpenSSL 1.1.1 [2]. Since the deadlock occurs at the early startup stage of bitcoin-qt, it renders bitcoin-qt entirely non-functional when compiled against OpenSSL 1.1.1 and Qt 5.11.2 (and possible future combinations of OpenSSL and Qt versions). This commit fixes #14359 by removing the redundant code. [1] https://code.qt.io/cgit/qt/qtbase.git/commit/?id=3fd2d9eff8c1f948306ee5fbfe364ccded1c4b84 [2] https://bugreports.qt.io/browse/QTBUG-70956 Github-Pull: #14403 Rebased-From: 7d173c4cd1885ff5bcf9e5f8f7f712138dd8a445 Tree-SHA512: 71a34b13202c834c5ca73bcb9b70efff26c34e1aac3b954f098620b62c2be53a8e319929c4764a5b5cc5d0dd163ff70f4eb3a4f1f608363b7d23d1b16b25ddc7
* | | Merge #14566: 0.17: qa backportsMarcoFalke2018-10-282-0/+23
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 9461f98c53 Disable wallet and address book Qt tests on macOS minimal platform (Russell Yanofsky) 703a24418c descriptors.md: Refer to descriptors as describing instead of matching (Russell Yanofsky) 5f51fd6d59 doc/descriptors.md tweaks (Russell Yanofsky) 29899ecd36 Import CInv from correct module (Chun Kuan Lee) f7adb32e38 qa: Run all tests even if wallet is not compiled (MarcoFalke) 86fadee990 qa: Premine to deterministic address with -disablewallet (MarcoFalke) 8bc1badada Test rpc_help.py failed: Check whether ZMQ is enabled or not. (Kvaciral) 24d796a6cc test: Add tests for RPC help (João Barbosa) 168efeaca6 qa: Use named args in some tests (MarcoFalke) 73e538cf6a scripted-diff: Use named arguments in feature_block (MarcoFalke) 96dc936862 scripted-diff: Pass node into p2p_segwit acceptance tests (MarcoFalke) 7ff32a6b98 qa: Add some actual witness in rpc_rawtransaction (MarcoFalke) b72fbabe17 [qa] Use correct python index slices in example test (Suhas Daftuar) 06544faff0 qa: Add TestNode::assert_debug_log (MarcoFalke) Pull request description: Just the test and doc changes from #14328 to prevent that one from piling up. Tree-SHA512: 51c1e66d346cbf51bc67b2f365448620dd9992ba4ef70592c5eb489cd50a047dab8179c86db2cafe161d8b2aa04498cc760fb5deb7eef49b39272911c74227a9
| * | | Disable wallet and address book Qt tests on macOS minimal platformRussell Yanofsky2018-10-242-0/+23
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | macOS Qt minimal platform is frequently broken, and these are currently failing with Qt 5.11.1. The tests do pass when run on the full cocoa platform (with `test_bitcoin-qt -platform cocoa`). Github-Pull: #14011 Rebased-From: a3197c5294df4711bab0ff6dcdd061ceab115c7d
* / / [doc] getblocktemplate: use SegWit in exampleSjors Provoost2018-10-181-2/+2
|/ /
* / Fix crash bug with duplicate inputs within a transactionSuhas Daftuar2018-09-171-1/+1
|/ | | | Introduced by #9049
* Replace duplcate reference with reference to reference docPieter Wuille2018-09-061-49/+2
| | | | | | Github-Pull: #14096 Rebased-From: 2b5d6f8df24b381d35b75187c97ae0cc9f7c3ed0 Tree-SHA512: 79af808c581ebb17d60aab8322b1debcc4182480b84eaedcbfac1e67c8b543c61df22789095742d67d732dba35e7e5fad77912385b695f89fb0f44f75db11560
* Adjust TODO linkPieter Wuille2018-09-061-1/+1
| | | | | | Github-Pull: #14096 Rebased-From: 89709db7a2710456011eac9dcd6a60d5e87b97ae Tree-SHA512: 0bf74e1179bee6e616d8fd2c125411ef30611d9aa3b32412025615a793abbc629a7b6d89a89ef05b11ac3541cc869c0caebba2d00942fdd6ab8d2e98d9b9caca
* util: Report parse errors in configuration fileWladimir J. van der Laan2018-09-061-5/+18
| | | | | | | | | | | | | | | | Report errors while parsing the configuration file, instead of silently ignoring them. $ src/bitcoind -regtest Error reading configuration file: parse error on line 22: nodebuglogfile, if you intended to specify a negated option, use nodebuglogfile=1 instead $ src/bitcoind -regtest Error reading configuration file: parse error on line 22: sdafsdfafs $ src/bitcoind -regtest Error reading configuration file: parse error on line 24: -nodebuglogfile=1, options in the configuration file must be specified without leading - Github-Pull: #14105 Rebased-From: a66c0f78a941968340f030911765a84219908c4d Tree-SHA512: 2b6be1ab643623e6ef9b53354820147a6c5d2baae3795ffe428fc60d8563ec00a68a379aee4029380f80f892abe23763afb1c75c32b60a13bffe7b82496bf2bb