Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
1ed1b6d
Merge #10095: refactor: Move GetDifficulty out of `rpc/server.h`
laanwj Mar 31, 2017
3547b2f
Merge #10129: scheduler: fix sub-second precision with boost < 1.50
laanwj Apr 1, 2017
1ba74bd
Merge #10136: build: Disable Wshadow warning
laanwj Apr 2, 2017
a4820a0
Merge #10128: Speed Up CuckooCache tests
laanwj Apr 2, 2017
901d469
Merge #10072: Remove sources of unreliablility in extended functional…
Apr 2, 2017
851deff
Merge #10077: [qa] Add setnetworkactive smoke test
laanwj Apr 2, 2017
d10714f
Merge #10058: No need to use OpenSSL malloc/free
laanwj Apr 3, 2017
55ccb72
Merge #9533: Allow non-power-of-2 signature cache sizes
laanwj Apr 3, 2017
23d38ff
Merge #10104: linearize script: Option to use RPC cookie
laanwj Apr 5, 2017
eac59bb
Merge #10166: Ignore Doxyfile generated from Doxyfile.in template.
laanwj Apr 10, 2017
115598a
Merge #9949: [bench] Avoid function call arguments which are pointers…
laanwj Apr 10, 2017
df1acd6
Merge #10135: [p2p] Send the correct error code in reject messages
laanwj Apr 10, 2017
aa7c200
Merge #10164: Wallet: reduce excess logic InMempool()
laanwj Apr 10, 2017
6bb6357
Merge #10177: Changed "Send" button default status from true to false
laanwj Apr 12, 2017
ebb8a32
Merge #9693: Prevent integer overflow in ReadVarInt.
sipa Apr 17, 2017
5dc67e7
Merge #10211: [doc] Contributor fixes & new "finding reviewers" section
laanwj Apr 18, 2017
48a8030
Merge #9827: Improve ScanForWalletTransactions return value
laanwj Apr 19, 2017
54daf70
Merge #10228: build: regenerate bitcoin-config.h as necessary
laanwj Apr 21, 2017
69de4e1
Merge #10273: [scripts] Minor improvements to `macdeployqtplus` script.
laanwj Apr 26, 2017
11862b7
Merge #9670: contrib: github-merge improvements
laanwj Apr 26, 2017
db30b8c
Merge #10486: devtools: Retry after signing fails in github-merge
laanwj Jun 1, 2017
9649feb
Merge #10469: Fixing typo in rpcdump.cpp
laanwj Jun 1, 2017
89e08a2
Merge #10514: Bugfix: missing == 0 after randrange
laanwj Jun 5, 2017
f6c1abc
Merge #10538: [trivial] Fix typo: "occurrences" (misspelled as "occur…
Jun 6, 2017
87bf500
Merge #10522: [wallet] Remove unused variables
Jun 6, 2017
43beb1c
Merge #10564: Return early in IsBanned.
sipa Jun 12, 2017
0fbad1f
Merge Bitcoin#9960: Trivial: Add const modifier to GetHDChain and IsH…
NicolasDorier May 12, 2019
5dd23a6
Drop duplicated block
charlesrocket Nov 5, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 33 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ fixes or code moves with actual code changes.

Commit messages should be verbose by default consisting of a short subject line
(50 chars max), a blank line and detailed explanatory text as separate
paragraph(s); unless the title alone is self-explanatory (like "Corrected typo
in init.cpp") then a single title line is sufficient. Commit messages should be
paragraph(s), unless the title alone is self-explanatory (like "Corrected typo
in init.cpp") in which case a single title line is sufficient. Commit messages should be
helpful to people reading your code in the future, so explain the reasoning for
your decisions. Further explanation [here](http://chris.beams.io/posts/git-commit/).

Expand Down Expand Up @@ -225,6 +225,37 @@ discussed extensively on the mailing list and IRC, be accompanied by a widely
discussed BIP and have a generally widely perceived technical consensus of being
a worthwhile change based on the judgement of the maintainers.

### Finding Reviewers

As most reviewers are themselves developers with their own projects, the review
process can be quite lengthy, and some amount of patience is required. If you find
that you've been waiting for a pull request to be given attention for several
months, there may be a number of reasons for this, some of which you can do something
about:

- It may be because of a feature freeze due to an upcoming release. During this time,
only bug fixes are taken into consideration. If your pull request is a new feature,
it will not be prioritized until the release is over. Wait for release.
- It may be because the changes you are suggesting do not appeal to people. Rather than
nits and critique, which require effort and means they care enough to spend time on your
contribution, thundering silence is a good sign of widespread (mild) dislike of a given change
(because people don't assume *others* won't actually like the proposal). Don't take
that personally, though! Instead, take another critical look at what you are suggesting
and see if it: changes too much, is too broad, doesn't adhere to the
[developer notes](doc/developer-notes.md), is dangerous or insecure, is messily written, etc.
Identify and address any of the issues you find. Then ask e.g. on IRC if someone could give
their opinion on the concept itself.
- It may be because your code is too complex for all but a few people. And those people
may not have realized your pull request even exists. A great way to find people who
are qualified and care about the code you are touching is the
[Git Blame feature](https://help.github.com/articles/tracing-changes-in-a-file/). Simply
find the person touching the code you are touching before you and see if you can find
them and give them a nudge. Don't be incessant about the nudging though.
- Finally, if all else fails, ask on IRC or elsewhere for someone to give your pull request
a look. If you think you've been waiting an unreasonably long amount of time (month+) for
no particular reason (few lines changed, etc), this is totally fine. Try to return the favor
when someone else is asking for feedback on their code, and universe balances out.


Release Policy
--------------
Expand Down
1 change: 0 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,6 @@ if test "x$CXXFLAGS_overridden" = "xno"; then
AX_CHECK_COMPILE_FLAG([-Wformat],[CXXFLAGS="$CXXFLAGS -Wformat"],,[[$CXXFLAG_WERROR]])
AX_CHECK_COMPILE_FLAG([-Wvla],[CXXFLAGS="$CXXFLAGS -Wvla"],,[[$CXXFLAG_WERROR]])
AX_CHECK_COMPILE_FLAG([-Wformat-security],[CXXFLAGS="$CXXFLAGS -Wformat-security"],,[[$CXXFLAG_WERROR]])
AX_CHECK_COMPILE_FLAG([-Wshadow],[CXXFLAGS="$CXXFLAGS -Wshadow"],,[[$CXXFLAG_WERROR]])

## Some compilers (gcc) ignore unknown -Wno-* options, but warn about all
## unknown options if any other warning is produced. Test the -Wfoo case, and
Expand Down
54 changes: 25 additions & 29 deletions contrib/devtools/github-merge.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright (c) 2016 The Bitcoin Core developers
# Copyright (c) 2016-2017 Bitcoin Core Developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.

Expand All @@ -15,7 +15,7 @@
# In case of a clean merge that is accepted by the user, the local branch with
# name $BRANCH is overwritten with the merged result, and optionally pushed.
from __future__ import division,print_function,unicode_literals
import os
import os,sys
from sys import stdin,stdout,stderr
import argparse
import hashlib
Expand Down Expand Up @@ -127,6 +127,9 @@ def tree_sha512sum(commit='HEAD'):
raise IOError('Non-zero return value executing git cat-file')
return overall.hexdigest()

def print_merge_details(pull, title, branch, base_branch, head_branch):
print('%s#%s%s %s %sinto %s%s' % (ATTR_RESET+ATTR_PR,pull,ATTR_RESET,title,ATTR_RESET+ATTR_PR,branch,ATTR_RESET))
subprocess.check_call([GIT,'log','--graph','--topo-order','--pretty=format:'+COMMIT_FORMAT,base_branch+'..'+head_branch])

def parse_arguments():
epilog = '''
Expand Down Expand Up @@ -171,7 +174,7 @@ def main():
info = retrieve_pr_info(repo,pull)
if info is None:
exit(1)
title = info['title']
title = info['title'].strip()
# precedence order for destination branch argument:
# - command line argument
# - githubmerge.branch setting
Expand Down Expand Up @@ -256,8 +259,7 @@ def main():
printf("ERROR: Cannot update message.",file=stderr)
exit(4)

print('%s#%s%s %s %sinto %s%s' % (ATTR_RESET+ATTR_PR,pull,ATTR_RESET,title,ATTR_RESET+ATTR_PR,branch,ATTR_RESET))
subprocess.check_call([GIT,'log','--graph','--topo-order','--pretty=format:'+COMMIT_FORMAT,base_branch+'..'+head_branch])
print_merge_details(pull, title, branch, base_branch, head_branch)
print()

# Run test command if configured.
Expand All @@ -276,12 +278,6 @@ def main():
print("Difference with github ignored.",file=stderr)
else:
exit(6)
reply = ask_prompt("Press 'd' to accept the diff.")
if reply.lower() == 'd':
print("Diff accepted.",file=stderr)
else:
print("ERROR: Diff rejected.",file=stderr)
exit(6)
else:
# Verify the result manually.
print("Dropping you on a shell so you can try building/testing the merged source.",file=stderr)
Expand All @@ -290,29 +286,25 @@ def main():
if os.path.isfile('/etc/debian_version'): # Show pull number on Debian default prompt
os.putenv('debian_chroot',pull)
subprocess.call([BASH,'-i'])
reply = ask_prompt("Type 'm' to accept the merge.")
if reply.lower() == 'm':
print("Merge accepted.",file=stderr)
else:
print("ERROR: Merge rejected.",file=stderr)
exit(7)

second_sha512 = tree_sha512sum()
if first_sha512 != second_sha512:
print("ERROR: Tree hash changed unexpectedly",file=stderr)
exit(8)

# Sign the merge commit.
reply = ask_prompt("Type 's' to sign off on the merge.")
if reply == 's':
try:
subprocess.check_call([GIT,'commit','-q','--gpg-sign','--amend','--no-edit'])
except subprocess.CalledProcessError as e:
print("Error signing, exiting.",file=stderr)
print_merge_details(pull, title, branch, base_branch, head_branch)
while True:
reply = ask_prompt("Type 's' to sign off on the above merge, or 'x' to reject and exit.").lower()
if reply == 's':
try:
subprocess.check_call([GIT,'commit','-q','--gpg-sign','--amend','--no-edit'])
break
except subprocess.CalledProcessError as e:
print("Error while signing, asking again.",file=stderr)
elif reply == 'x':
print("Not signing off on merge, exiting.",file=stderr)
exit(1)
else:
print("Not signing off on merge, exiting.",file=stderr)
exit(1)

# Put the result in branch.
subprocess.check_call([GIT,'checkout','-q',branch])
Expand All @@ -326,9 +318,13 @@ def main():
subprocess.call([GIT,'branch','-q','-D',local_merge_branch],stderr=devnull)

# Push the result.
reply = ask_prompt("Type 'push' to push the result to %s, branch %s." % (host_repo,branch))
if reply.lower() == 'push':
subprocess.check_call([GIT,'push',host_repo,'refs/heads/'+branch])
while True:
reply = ask_prompt("Type 'push' to push the result to %s, branch %s, or 'x' to exit without pushing." % (host_repo,branch)).lower()
if reply == 'push':
subprocess.check_call([GIT,'push',host_repo,'refs/heads/'+branch])
break
elif reply == 'x':
exit(1)

if __name__ == '__main__':
main()
Expand Down
3 changes: 2 additions & 1 deletion contrib/linearize/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ https://github.com/axerunners/axe_hash
$ ./linearize-hashes.py linearize.cfg > hashlist.txt

Required configuration file settings for linearize-hashes:
* RPC: `rpcuser`, `rpcpassword`
* RPC: `datadir` (Required if `rpcuser` and `rpcpassword` are not specified)
* RPC: `rpcuser`, `rpcpassword` (Required if `datadir` is not specified)

Optional config file setting for linearize-hashes:
* RPC: `host` (Default: `127.0.0.1`)
Expand Down
1 change: 1 addition & 0 deletions contrib/linearize/example-linearize.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# bitcoind RPC settings (linearize-hashes)
rpcuser=someuser
rpcpassword=somepassword
#datadir=~/.bitcoin
host=127.0.0.1
port=9337

Expand Down
23 changes: 22 additions & 1 deletion contrib/linearize/linearize-hashes.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
import re
import base64
import sys
import os
import os.path

settings = {}

Expand Down Expand Up @@ -93,6 +95,14 @@ def get_block_hashes(settings, max_blocks_per_call=10000):

height += num_blocks

def get_rpc_cookie():
# Open the cookie file
with open(os.path.join(os.path.expanduser(settings['datadir']), '.cookie'), 'r') as f:
combined = f.readline()
combined_split = combined.split(":")
settings['rpcuser'] = combined_split[0]
settings['rpcpassword'] = combined_split[1]

if __name__ == '__main__':
if len(sys.argv) != 2:
print("Usage: linearize-hashes.py CONFIG-FILE")
Expand Down Expand Up @@ -122,8 +132,15 @@ def get_block_hashes(settings, max_blocks_per_call=10000):
settings['max_height'] = 313000
if 'rev_hash_bytes' not in settings:
settings['rev_hash_bytes'] = 'false'

use_userpass = True
use_datadir = False
if 'rpcuser' not in settings or 'rpcpassword' not in settings:
print("Missing username and/or password in cfg file", file=stderr)
use_userpass = False
if 'datadir' in settings and not use_userpass:
use_datadir = True
if not use_userpass and not use_datadir:
print("Missing datadir or username and/or password in cfg file", file=stderr)
sys.exit(1)

settings['port'] = int(settings['port'])
Expand All @@ -133,4 +150,8 @@ def get_block_hashes(settings, max_blocks_per_call=10000):
# Force hash byte format setting to be lowercase to make comparisons easier.
settings['rev_hash_bytes'] = settings['rev_hash_bytes'].lower()

# Get the rpc user and pass from the cookie if the datadir is set
if use_datadir:
get_rpc_cookie()

get_block_hashes(settings)
6 changes: 2 additions & 4 deletions contrib/macdeploy/macdeployqtplus
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,6 @@ def copyFramework(framework, path, verbose):
if os.path.exists(fromContentsDir):
toContentsDir = os.path.join(path, framework.destinationVersionContentsDirectory)
shutil.copytree(fromContentsDir, toContentsDir, symlinks=True)
contentslinkfrom = os.path.join(path, framework.destinationContentsDirectory)
if verbose >= 3:
print("Copied Contents:", fromContentsDir)
print(" to:", toContentsDir)
Expand Down Expand Up @@ -674,9 +673,8 @@ else:
if verbose >= 2:
print("+ Installing qt.conf +")

f = open(os.path.join(applicationBundle.resourcesPath, "qt.conf"), "wb")
f.write(qt_conf.encode())
f.close()
with open(os.path.join(applicationBundle.resourcesPath, "qt.conf"), "wb") as f:
f.write(qt_conf.encode())

# ------------------------------------------------

Expand Down
1 change: 1 addition & 0 deletions doc/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Doxyfile
2 changes: 2 additions & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ BITCOIN_CORE_H = \
protocol.h \
random.h \
reverselock.h \
rpc/blockchain.h \
rpc/client.h \
rpc/protocol.h \
rpc/server.h \
Expand Down Expand Up @@ -638,6 +639,7 @@ config/stamp-h1: $(top_srcdir)/$(subdir)/config/axe-config.h.in $(top_builddir)/
$(top_srcdir)/$(subdir)/config/axe-config.h.in: $(am__configure_deps)
$(AM_V_at)$(MAKE) -C $(top_srcdir) $(subdir)/config/axe-config.h.in


clean-local:
-$(MAKE) -C secp256k1 clean
-$(MAKE) -C univalue clean
Expand Down
4 changes: 2 additions & 2 deletions src/bench/checkblock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ static void DeserializeBlockTest(benchmark::State& state)
CDataStream stream((const char*)raw_bench::block813851,
(const char*)&raw_bench::block813851[sizeof(raw_bench::block813851)],
SER_NETWORK, PROTOCOL_VERSION);
char a;
char a = '\0';
stream.write(&a, 1); // Prevent compaction

while (state.KeepRunning()) {
Expand All @@ -35,7 +35,7 @@ static void DeserializeAndCheckBlockTest(benchmark::State& state)
CDataStream stream((const char*)raw_bench::block813851,
(const char*)&raw_bench::block813851[sizeof(raw_bench::block813851)],
SER_NETWORK, PROTOCOL_VERSION);
char a;
char a = '\0';
stream.write(&a, 1); // Prevent compaction

Consensus::Params params = Params(CBaseChainParams::MAIN).GetConsensus();
Expand Down
2 changes: 1 addition & 1 deletion src/coins.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ void AddCoins(CCoinsViewCache& cache, const CTransaction &tx, int nHeight) {
const uint256& txid = tx.GetHash();
for (size_t i = 0; i < tx.vout.size(); ++i) {
// Pass fCoinbase as the possible_overwrite flag to AddCoin, in order to correctly
// deal with the pre-BIP30 occurrances of duplicate coinbase transactions.
// deal with the pre-BIP30 occurrences of duplicate coinbase transactions.
cache.AddCoin(COutPoint(txid, i), Coin(tx.vout[i], nHeight, fCoinbase), fCoinbase);
}
}
Expand Down
29 changes: 11 additions & 18 deletions src/cuckoocache.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ class bit_packed_atomic_flags
* @tparam Element should be a movable and copyable type
* @tparam Hash should be a function/callable which takes a template parameter
* hash_select and an Element and extracts a hash from it. Should return
* high-entropy hashes for `Hash h; h<0>(e) ... h<7>(e)`.
* high-entropy uint32_t hashes for `Hash h; h<0>(e) ... h<7>(e)`.
*/
template <typename Element, typename Hash>
class cache
Expand Down Expand Up @@ -193,12 +193,6 @@ class cache
*/
uint32_t epoch_size;

/** hash_mask should be set to appropriately mask out a hash such that every
* masked hash is [0,size), eg, if floor(log2(size)) == 20, then hash_mask
* should be (1<<20)-1
*/
uint32_t hash_mask;

/** depth_limit determines how many elements insert should try to replace.
* Should be set to log2(n)*/
uint8_t depth_limit;
Expand All @@ -217,14 +211,14 @@ class cache
*/
inline std::array<uint32_t, 8> compute_hashes(const Element& e) const
{
return {{hash_function.template operator()<0>(e) & hash_mask,
hash_function.template operator()<1>(e) & hash_mask,
hash_function.template operator()<2>(e) & hash_mask,
hash_function.template operator()<3>(e) & hash_mask,
hash_function.template operator()<4>(e) & hash_mask,
hash_function.template operator()<5>(e) & hash_mask,
hash_function.template operator()<6>(e) & hash_mask,
hash_function.template operator()<7>(e) & hash_mask}};
return {{(uint32_t)((hash_function.template operator()<0>(e) * (uint64_t)size) >> 32),
(uint32_t)((hash_function.template operator()<1>(e) * (uint64_t)size) >> 32),
(uint32_t)((hash_function.template operator()<2>(e) * (uint64_t)size) >> 32),
(uint32_t)((hash_function.template operator()<3>(e) * (uint64_t)size) >> 32),
(uint32_t)((hash_function.template operator()<4>(e) * (uint64_t)size) >> 32),
(uint32_t)((hash_function.template operator()<5>(e) * (uint64_t)size) >> 32),
(uint32_t)((hash_function.template operator()<6>(e) * (uint64_t)size) >> 32),
(uint32_t)((hash_function.template operator()<7>(e) * (uint64_t)size) >> 32)}};
}

/* end
Expand Down Expand Up @@ -305,7 +299,7 @@ class cache
}

/** setup initializes the container to store no more than new_size
* elements. setup rounds down to a power of two size.
* elements.
*
* setup should only be called once.
*
Expand All @@ -316,8 +310,7 @@ class cache
{
// depth_limit must be at least one otherwise errors can occur.
depth_limit = static_cast<uint8_t>(std::log2(static_cast<float>(std::max((uint32_t)2, new_size))));
size = 1 << depth_limit;
hash_mask = size-1;
size = std::max<uint32_t>(2, new_size);
table.resize(size);
collection_flags.setup(size);
epoch_flags.resize(size);
Expand Down
1 change: 1 addition & 0 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "policy/policy.h"
#include "rpc/server.h"
#include "rpc/register.h"
#include "rpc/blockchain.h"
#include "script/standard.h"
#include "script/sigcache.h"
#include "scheduler.h"
Expand Down
Loading