Skip to content

Commit

Permalink
Merge pull request bitcoin#468 from ptschip/release1
Browse files Browse the repository at this point in the history
Backports for 450 and additional
  • Loading branch information
gandrewstone committed Apr 24, 2017
2 parents 6a06bda + 7101b72 commit cd044f1
Show file tree
Hide file tree
Showing 15 changed files with 1,424 additions and 253 deletions.
3 changes: 1 addition & 2 deletions doc/bu-xthin-protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ In addition to the above, the following functionalities and configurations will

- An XTHIN service bit

- If the thinblocks service bit is turned off then your node you will not be able to request thinkblocks but requests for thinblocks from other nodes
will still be serviced.
- If the thinblocks service bit is turned off then your node you will not be able to request thinkblocks or receive thinblocks.

- The coinbase transaction will always be included in the thinblock.

Expand Down
2 changes: 1 addition & 1 deletion qa/rpc-tests/p2p-versionbits-warning.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def setup_network(self):
# Open and close to create zero-length file
with open(self.alert_filename, 'w') as f:
pass
self.node_options = ["-debug", "-logtimemicros=1", "-alertnotify=echo %s >> \"" + self.alert_filename + "\""]
self.node_options = ["-debug", "-logtimemicros=1", "-whitelist=127.0.0.1", "-alertnotify=echo %s >> \"" + self.alert_filename + "\""]
self.nodes.append(start_node(0, self.options.tmpdir, self.node_options))

import re
Expand Down
13 changes: 10 additions & 3 deletions qa/rpc-tests/txn_clone.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,16 @@ def add_options(self, parser):
parser.add_option("--mineblock", dest="mine_block", default=False, action="store_true",
help="Test double-spend of 1-confirmed transaction")

def setup_network(self):
# Start with split network:
return super(TxnMallTest, self).setup_network(True)
def setup_network(self, split=True):
self.nodes = []
self.nodes.append(start_node(0, self.options.tmpdir, ["-use-thinblocks=0"]))
self.nodes.append(start_node(1, self.options.tmpdir, ["-use-thinblocks=0"]))
self.nodes.append(start_node(2, self.options.tmpdir,["-use-thinblocks=0"]))
self.nodes.append(start_node(3, self.options.tmpdir,["-use-thinblocks=0"]))
connect_nodes_bi(self.nodes,0,1)
connect_nodes_bi(self.nodes,2,3)
self.is_network_split=True
self.sync_all()

def run_test(self):
# All nodes should start with 1,250 BTC:
Expand Down
1 change: 1 addition & 0 deletions src/Makefile.test.include
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ BITCOIN_TESTS =\
test/compress_tests.cpp \
test/crypto_tests.cpp \
test/DoS_tests.cpp \
test/exploit_tests.cpp \
test/getarg_tests.cpp \
test/hash_tests.cpp \
test/key_tests.cpp \
Expand Down
69 changes: 52 additions & 17 deletions src/globals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ std::map<std::pair<void*, void*>, LockStack> lockorders;
boost::thread_specific_ptr<LockStack> lockstack;
#endif



// main.cpp CriticalSections:
CCriticalSection cs_LastBlockFile;
CCriticalSection cs_nBlockSequenceId;
Expand Down Expand Up @@ -162,23 +164,56 @@ CCriticalSection cs_orphancache;
map<uint256, COrphanTx> mapOrphanTransactions GUARDED_BY(cs_orphancache);
map<uint256, set<uint256> > mapOrphanTransactionsByPrev GUARDED_BY(cs_orphancache);

CTweakRef<unsigned int> ebTweak("net.excessiveBlock","Excessive block size in bytes", &excessiveBlockSize,&ExcessiveBlockValidator);
CTweak<uint64_t> blockSigopsPerMb("net.excessiveSigopsPerMb","Excessive effort per block, denoted in cost (# inputs * txsize) per MB",BLOCKSTREAM_CORE_MAX_BLOCK_SIGOPS);
CTweak<uint64_t> blockMiningSigopsPerMb("mining.excessiveSigopsPerMb","Excessive effort per block, denoted in cost (# inputs * txsize) per MB",BLOCKSTREAM_CORE_MAX_BLOCK_SIGOPS);
CTweak<uint64_t> coinbaseReserve("mining.coinbaseReserve","How much space to reserve for the coinbase transaction, in bytes",DEFAULT_COINBASE_RESERVE_SIZE);
CTweakRef<std::string> miningCommentTweak("mining.comment","Include text in a block's coinbase.",&minerComment);
CTweakRef<uint64_t> miningBlockSize("mining.blockSize","Maximum block size in bytes. The maximum block size returned from 'getblocktemplate' will be this value minus mining.coinbaseReserve.",&maxGeneratedBlock,&MiningBlockSizeValidator);

CTweak<unsigned int> maxTxSize("net.excessiveTx","Largest transaction size in bytes", DEFAULT_LARGEST_TRANSACTION);
CTweakRef<unsigned int> eadTweak("net.excessiveAcceptDepth","Excessive block chain acceptance depth in blocks", &excessiveAcceptDepth);
CTweakRef<int> maxOutConnectionsTweak("net.maxOutboundConnections","Maximum number of outbound connections", &nMaxOutConnections,&OutboundConnectionValidator);
CTweakRef<int> maxConnectionsTweak("net.maxConnections","Maximum number of connections connections",&nMaxConnections);
CTweakRef<unsigned int> triTweak("net.txRetryInterval","How long to wait in microseconds before requesting a transaction from another source", &MIN_TX_REQUEST_RETRY_INTERVAL); // When should I request a tx from someone else (in microseconds). cmdline/bitcoin.conf: -txretryinterval
CTweakRef<unsigned int> briTweak("net.blockRetryInterval","How long to wait in microseconds before requesting a block from another source", &MIN_BLK_REQUEST_RETRY_INTERVAL); // When should I request a block from someone else (in microseconds). cmdline/bitcoin.conf: -blkretryinterval

CTweakRef<std::string> subverOverrideTweak("net.subversionOverride","If set, this field will override the normal subversion field. This is useful if you need to hide your node.",&subverOverride,&SubverValidator);

CTweak<CAmount> maxTxFee("wallet.maxTxFee","Maximum total fees to use in a single wallet transaction or raw transaction; setting this too low may abort large transactions.",DEFAULT_TRANSACTION_MAXFEE);
CTweakRef<unsigned int> ebTweak("net.excessiveBlock",
"Excessive block size in bytes",
&excessiveBlockSize,
&ExcessiveBlockValidator);
CTweak<uint64_t> blockSigopsPerMb("net.excessiveSigopsPerMb",
"Excessive effort per block, denoted in cost (# inputs * txsize) per MB",
BLOCKSTREAM_CORE_MAX_BLOCK_SIGOPS);
CTweak<uint64_t> blockMiningSigopsPerMb("mining.excessiveSigopsPerMb",
"Excessive effort per block, denoted in cost (# inputs * txsize) per MB",
BLOCKSTREAM_CORE_MAX_BLOCK_SIGOPS);
CTweak<uint64_t> coinbaseReserve("mining.coinbaseReserve",
"How much space to reserve for the coinbase transaction, in bytes",
DEFAULT_COINBASE_RESERVE_SIZE);
CTweakRef<std::string> miningCommentTweak("mining.comment", "Include text in a block's coinbase.", &minerComment);
CTweakRef<uint64_t> miningBlockSize("mining.blockSize",
"Maximum block size in bytes. The maximum block size returned from 'getblocktemplate' will be this value minus "
"mining.coinbaseReserve.",
&maxGeneratedBlock,
&MiningBlockSizeValidator);

CTweak<unsigned int> maxTxSize("net.excessiveTx", "Largest transaction size in bytes", DEFAULT_LARGEST_TRANSACTION);
CTweakRef<unsigned int> eadTweak("net.excessiveAcceptDepth",
"Excessive block chain acceptance depth in blocks",
&excessiveAcceptDepth);
CTweakRef<int> maxOutConnectionsTweak("net.maxOutboundConnections",
"Maximum number of outbound connections",
&nMaxOutConnections,
&OutboundConnectionValidator);
CTweakRef<int> maxConnectionsTweak("net.maxConnections", "Maximum number of connections", &nMaxConnections);
CTweakRef<int> minXthinNodesTweak("net.minXthinNodes",
"Minimum number of outbound xthin capable nodes to connect to",
&nMinXthinNodes);
// When should I request a tx from someone else (in microseconds). cmdline/bitcoin.conf: -txretryinterval
CTweakRef<unsigned int> triTweak("net.txRetryInterval",
"How long to wait in microseconds before requesting a transaction from another source",
&MIN_TX_REQUEST_RETRY_INTERVAL);
// When should I request a block from someone else (in microseconds). cmdline/bitcoin.conf: -blkretryinterval
CTweakRef<unsigned int> briTweak("net.blockRetryInterval",
"How long to wait in microseconds before requesting a block from another source",
&MIN_BLK_REQUEST_RETRY_INTERVAL);

CTweakRef<std::string> subverOverrideTweak("net.subversionOverride",
"If set, this field will override the normal subversion field. This is useful if you need to hide your node.",
&subverOverride,
&SubverValidator);

CTweak<CAmount> maxTxFee("wallet.maxTxFee",
"Maximum total fees to use in a single wallet transaction or raw transaction; setting this too low may abort large "
"transactions.",
DEFAULT_TRANSACTION_MAXFEE);

/** Number of blocks that can be requested at any given time from a single peer. */
CTweak<unsigned int> maxBlocksInTransitPerPeer("net.maxBlocksInTransitPerPeer","Number of blocks that can be requested at any given time from a single peer. 0 means use algorithm.",0);
Expand Down
Loading

0 comments on commit cd044f1

Please sign in to comment.