forked from bitcoin/bitcoin
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Backports 0.16 pr11 #3361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
UdjinM6
merged 17 commits into
dashpay:develop
from
PastaPastaPasta:backports-0.16-pr11
Mar 19, 2020
Merged
Backports 0.16 pr11 #3361
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
0c97cd5
Merge #11710: cli: Reject arguments to -getinfo
laanwj 26281c0
Merge #10154: init: Remove redundant logging code
laanwj 62987be
Merge #11191: RPC: Improve help text and behavior of RPC-logging.
laanwj e2c7d1f
add include
PastaPastaPasta d8d18d6
Merge #11714: [tests] Test that mempool rejects coinbase transactions
1948435
Merge #12302: test: Make ua_comment test pass on 0.16.0
8095699
Merge #12367: Fix two fast-shutdown bugs
laanwj 7e5c5d4
Merge #12377: qt: Poll ShutdownTimer after init is done
laanwj aa34483
Merge #12374: qt: Make sure splash screen is freed on AppInitMain fail
laanwj 78d303c
Merge #12368: Hold mempool.cs for the duration of ATMP.
laanwj 5e19f32
Merge #12401: Reset pblocktree before deleting LevelDB file
laanwj 99caed2
Merge #12415: Interrupt loading thread after shutdown request
laanwj b447c5a
Merge #12349: shutdown: fix crash on shutdown with reindex-chainstate
laanwj ce08cce
Merge #12556: [Trivial] fix version typo in getpeerinfo RPC call help
laanwj 75f32fb
Merge #11309: Minor cleanups for AcceptToMemoryPool
9a2fa43
Remove "> 0" from IsArgSet call
PastaPastaPasta b46693e
Apply the same fix to evoDb and deterministicMNManager as pblocktree
PastaPastaPasta File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,7 @@ | |
| #include "sync.h" | ||
| #include "univalue.h" | ||
|
|
||
| #include <functional> | ||
| #include <set> | ||
|
|
||
| class CDataStream; | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| // Copyright (c) 2017 The Bitcoin Core developers | ||
| // Distributed under the MIT software license, see the accompanying | ||
| // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||
|
|
||
| #include <validation.h> | ||
| #include <txmempool.h> | ||
| #include <amount.h> | ||
| #include <consensus/validation.h> | ||
| #include <primitives/transaction.h> | ||
| #include <script/script.h> | ||
| #include <test/test_dash.h> | ||
|
|
||
| #include <boost/test/unit_test.hpp> | ||
|
|
||
|
|
||
| BOOST_AUTO_TEST_SUITE(txvalidation_tests) | ||
|
|
||
| /** | ||
| * Ensure that the mempool won't accept coinbase transactions. | ||
| */ | ||
| BOOST_FIXTURE_TEST_CASE(tx_mempool_reject_coinbase, TestChain100Setup) | ||
| { | ||
| CScript scriptPubKey = CScript() << ToByteVector(coinbaseKey.GetPubKey()) << OP_CHECKSIG; | ||
| CMutableTransaction coinbaseTx; | ||
|
|
||
| coinbaseTx.nVersion = 1; | ||
| coinbaseTx.vin.resize(1); | ||
| coinbaseTx.vout.resize(1); | ||
| coinbaseTx.vin[0].scriptSig = CScript() << OP_11 << OP_EQUAL; | ||
| coinbaseTx.vout[0].nValue = 1 * CENT; | ||
| coinbaseTx.vout[0].scriptPubKey = scriptPubKey; | ||
|
|
||
| assert(CTransaction(coinbaseTx).IsCoinBase()); | ||
|
|
||
| CValidationState state; | ||
|
|
||
| LOCK(cs_main); | ||
|
|
||
| unsigned int initialPoolSize = mempool.size(); | ||
|
|
||
| BOOST_CHECK_EQUAL( | ||
| false, | ||
| AcceptToMemoryPool(mempool, state, MakeTransactionRef(coinbaseTx), | ||
| nullptr /* pfMissingInputs */, | ||
| true /* bypass_limits */, | ||
| 0 /* nAbsurdFee */)); | ||
|
|
||
| // Check that the transaction hasn't been added to mempool. | ||
| BOOST_CHECK_EQUAL(mempool.size(), initialPoolSize); | ||
|
|
||
| // Check that the validation state reflects the unsuccesful attempt. | ||
| BOOST_CHECK(state.IsInvalid()); | ||
| BOOST_CHECK_EQUAL(state.GetRejectReason(), "coinbase"); | ||
|
|
||
| int nDoS; | ||
| BOOST_CHECK_EQUAL(state.IsInvalid(nDoS), true); | ||
| BOOST_CHECK_EQUAL(nDoS, 100); | ||
| } | ||
|
|
||
| BOOST_AUTO_TEST_SUITE_END() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.