Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
bdb01ad
qa: Normalize executable location
Apr 19, 2018
e071db1
[tests] Make rpcauth.py testable and add unit tests
nixbox Apr 23, 2018
73a52bc
test: add rpcauth-test to AC_CONFIG_LINKS to fix out-of-tree make check
laanwj Apr 25, 2018
1d47225
[tests] [qt] Introduce qt/test/util with a generalized ConfirmMessage
jamesob Mar 29, 2018
c46d520
Add purpose arg to Wallet::getAddress
jamesob Apr 10, 2018
4e6cc01
[qt] Display more helpful message when adding a send address has failed
jamesob Apr 10, 2018
f5fb9a7
[tests] [qt] Add tests for address book manipulation via EditAddressD…
jamesob Mar 29, 2018
8cf52d4
Don't test against min relay fee information in mining_prioritisetran…
kristapsk Apr 25, 2018
2ed9444
[db] Create separate database for txindex.
Dec 12, 2017
7bd44d6
[db] Migration for txindex data to new, separate database.
Dec 12, 2017
de552a4
[index] Create new TxIndex class.
Dec 8, 2017
c54566d
[index] TxIndex initial sync thread.
Dec 8, 2017
c2817e3
[index] Allow TxIndex sync thread to be interrupted.
Dec 8, 2017
2498df9
[index] TxIndex method to wait until caught up.
Dec 8, 2017
1bd44d3
[init] Initialize and start TxIndex in init code.
Dec 8, 2017
07b65b7
[validation] Replace tx index code in validation code with TxIndex.
Dec 8, 2017
faab1e7
[index] Move disk IO logic from GetTransaction to TxIndex::FindTx.
Mar 30, 2018
9a3b5d9
[rpc] Public interfaces to GetTransaction block until synced.
Dec 8, 2017
4b77934
[test] Simple unit test for TxIndex.
Dec 8, 2017
935200a
[doc] Include txindex changes in the release notes.
Mar 8, 2018
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
3 changes: 2 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,8 @@ EXTRA_DIST += \
test/util/data/txcreatescript4.json \
test/util/data/txcreatesignv1.hex \
test/util/data/txcreatesignv1.json \
test/util/data/txcreatesignv2.hex
test/util/data/txcreatesignv2.hex \
test/util/rpcauth-test.py

CLEANFILES = $(OSX_DMG) $(BITCOIN_WIN_INSTALLER)

Expand Down
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1326,6 +1326,7 @@ AM_COND_IF([HAVE_DOXYGEN], [AC_CONFIG_FILES([doc/Doxyfile])])
AC_CONFIG_LINKS([contrib/filter-lcov.py:contrib/filter-lcov.py])
AC_CONFIG_LINKS([test/functional/test_runner.py:test/functional/test_runner.py])
AC_CONFIG_LINKS([test/util/bitcoin-util-test.py:test/util/bitcoin-util-test.py])
AC_CONFIG_LINKS([test/util/rpcauth-test.py:test/util/rpcauth-test.py])

dnl boost's m4 checks do something really nasty: they export these vars. As a
dnl result, they leak into secp256k1's configure and crazy things happen.
Expand Down
1 change: 1 addition & 0 deletions doc/files.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* db.log: wallet database log file; moved to wallets/ directory on new installs since 0.16.0
* debug.log: contains debug information and general logging generated by bitcoind or bitcoin-qt
* fee_estimates.dat: stores statistics used to estimate minimum transaction fees and priorities required for confirmation; since 0.10.0
* indexes/txindex/*: optional transaction index database (LevelDB); since 0.17.0
* mempool.dat: dump of the mempool's transactions; since 0.14.0.
* peers.dat: peer IP address database (custom format); since 0.7.0
* wallet.dat: personal wallet (BDB) with keys and transactions; moved to wallets/ directory on new installs since 0.16.0
Expand Down
11 changes: 11 additions & 0 deletions doc/release-notes-pr13033.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Transaction index changes
-------------------------

The transaction index is now built separately from the main node procedure,
meaning the `-txindex` flag can be toggled without a full reindex. If bitcoind
is run with `-txindex` on a node that is already partially or fully synced
without one, the transaction index will be built in the background and become
available once caught up. When switching from running `-txindex` to running
without the flag, the transaction index database will *not* be deleted
automatically, meaning it could be turned back on at a later time without a full
resync.
46 changes: 28 additions & 18 deletions share/rpcauth/rpcauth.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
# Copyright (c) 2015-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.

import sys
Expand All @@ -9,26 +9,36 @@
import base64
import hmac

if len(sys.argv) < 2:
sys.stderr.write('Please include username as an argument.\n')
sys.exit(0)
def generate_salt():
# This uses os.urandom() underneath
cryptogen = SystemRandom()

username = sys.argv[1]
# Create 16 byte hex salt
salt_sequence = [cryptogen.randrange(256) for _ in range(16)]
return ''.join([format(r, 'x') for r in salt_sequence])

#This uses os.urandom() underneath
cryptogen = SystemRandom()
def generate_password(salt):
"""Create 32 byte b64 password"""
password = base64.urlsafe_b64encode(os.urandom(32)).decode('utf-8')

#Create 16 byte hex salt
salt_sequence = [cryptogen.randrange(256) for i in range(16)]
hexseq = list(map(hex, salt_sequence))
salt = "".join([x[2:] for x in hexseq])
m = hmac.new(bytearray(salt, 'utf-8'), bytearray(password, 'utf-8'), 'SHA256')
password_hmac = m.hexdigest()

#Create 32 byte b64 password
password = base64.urlsafe_b64encode(os.urandom(32)).decode("utf-8")
return password, password_hmac

m = hmac.new(bytearray(salt, 'utf-8'), bytearray(password, 'utf-8'), "SHA256")
result = m.hexdigest()
def main():
if len(sys.argv) < 2:
sys.stderr.write('Please include username as an argument.\n')
sys.exit(0)

print("String to be appended to bitcoin.conf:")
print("rpcauth="+username+":"+salt+"$"+result)
print("Your password:\n"+password)
username = sys.argv[1]

salt = generate_salt()
password, password_hmac = generate_password(salt)

print('String to be appended to bitcoin.conf:')
print('rpcauth={0}:{1}${2}'.format(username, salt, password_hmac))
print('Your password:\n{0}'.format(password))

if __name__ == '__main__':
main()
2 changes: 2 additions & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ BITCOIN_CORE_H = \
fs.h \
httprpc.h \
httpserver.h \
index/txindex.h \
indirectmap.h \
init.h \
interfaces/handler.h \
Expand Down Expand Up @@ -208,6 +209,7 @@ libbitcoin_server_a_SOURCES = \
consensus/tx_verify.cpp \
httprpc.cpp \
httpserver.cpp \
index/txindex.cpp \
init.cpp \
dbwrapper.cpp \
merkleblock.cpp \
Expand Down
5 changes: 5 additions & 0 deletions src/Makefile.qttest.include
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@ TEST_QT_MOC_CPP = \

if ENABLE_WALLET
TEST_QT_MOC_CPP += \
qt/test/moc_addressbooktests.cpp \
qt/test/moc_paymentservertests.cpp \
qt/test/moc_wallettests.cpp
endif

TEST_QT_H = \
qt/test/addressbooktests.h \
qt/test/compattests.h \
qt/test/rpcnestedtests.h \
qt/test/uritests.h \
qt/test/util.h \
qt/test/paymentrequestdata.h \
qt/test/paymentservertests.h \
qt/test/wallettests.h
Expand All @@ -38,11 +41,13 @@ qt_test_test_bitcoin_qt_SOURCES = \
qt/test/rpcnestedtests.cpp \
qt/test/test_main.cpp \
qt/test/uritests.cpp \
qt/test/util.cpp \
$(TEST_QT_H) \
$(TEST_BITCOIN_CPP) \
$(TEST_BITCOIN_H)
if ENABLE_WALLET
qt_test_test_bitcoin_qt_SOURCES += \
qt/test/addressbooktests.cpp \
qt/test/paymentservertests.cpp \
qt/test/wallettests.cpp \
wallet/test/wallet_test_fixture.cpp
Expand Down
3 changes: 3 additions & 0 deletions src/Makefile.test.include
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ BITCOIN_TESTS =\
test/timedata_tests.cpp \
test/torcontrol_tests.cpp \
test/transaction_tests.cpp \
test/txindex_tests.cpp \
test/txvalidation_tests.cpp \
test/txvalidationcache_tests.cpp \
test/versionbits_tests.cpp \
Expand Down Expand Up @@ -156,6 +157,8 @@ bitcoin_test_clean : FORCE
check-local: $(BITCOIN_TESTS:.cpp=.cpp.test)
@echo "Running test/util/bitcoin-util-test.py..."
$(PYTHON) $(top_builddir)/test/util/bitcoin-util-test.py
@echo "Running test/util/rpcauth-test.py..."
$(PYTHON) $(top_builddir)/test/util/rpcauth-test.py
$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C secp256k1 check
if EMBEDDED_UNIVALUE
$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C univalue check
Expand Down
3 changes: 3 additions & 0 deletions src/dbwrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,9 @@ class CDBWrapper
CDBWrapper(const fs::path& path, size_t nCacheSize, bool fMemory = false, bool fWipe = false, bool obfuscate = false);
~CDBWrapper();

CDBWrapper(const CDBWrapper&) = delete;
CDBWrapper& operator=(const CDBWrapper&) = delete;

template <typename K, typename V>
bool Read(const K& key, V& value) const
{
Expand Down
Loading