Browse Source
0.13b70b4a2
Trivial: Fix typo (Marty Jones)702fd2e
[copyright] add MIT license headers to .sh scripts where missing (isle2983)a60d7cc
[copyright] Add missing copyright headers (isle2983)ea2a6be
[copyright] add MIT License copyright header to remaining Python files (isle2983)9a903f9
[copyright] add MIT License copyright header to zmq_sub.py (isle2983)084cae9
UndoReadFromDisk works on undo files (rev), not on block files. (Pavel Janík)e34374e
[qa] wallet: Check legacy wallet as well (MarcoFalke)d31ac72
Specify Protobuf version 2 in paymentrequest.proto (fanquake)5e15fce
Minor change in section name (Anders Øyvind Urke-Sætre)0e2c6bd
[Doc] Target protobuf 2.6 in OS X build notes. (Michael Ford)da94272
[qa] walletbackup: Sync blocks inside the loop (MarcoFalke)42ea51a
net: No longer send local address in addrMe (Wladimir J. van der Laan)ea51b0f
Berkeley DB v6 compatibility fix (Alexey Vesnin)0a35573
[doc] - clarify statement about parallel jobs in rpc-tests.py (isle2983)752fbae
contrib: Make fix-copyright-headers.py more portable (MarcoFalke)486650a
[doc] Fix typos in comments, doxygen: Fix comment syntax (MarcoFalke)c18a9ca
[qa] pull-tester: Don't mute zmq ImportError (MarcoFalke)9556745
init: Fix typo in help message for -whitelistforcerelay (Wladimir J. van der Laan)4f84082
Set jonasschnellis dns-seeder filter flag (Jonas Schnelli)863ae74
[doc] Update git-subtree-check.sh README (MarcoFalke)c493f43
Trivial: Fix two VarInt examples in serialize.h (Christian Barcenas)cb07f19
CDB: fix debug output (crowning-)75d5484
Add copyright header to wallet_text_fixture.cpp (Wladimir J. van der Laan)305d8ac
Use __func__ to get function name for output printing (MarcoFalke)464dedd
[Wallet] Trivial cleanup of HD wallet changes (Jonas Schnelli)b17a3f9
document return value of networkhashps for getmininginfo RPC endpoint (Jameson Lopp)a27cdd8
[qa] abandonconflict: Use assert_equal (MarcoFalke)befe654
various typos (leijurv)4e5fc31
Fix a type error that would not compile on Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn) (Jeremy Rubin)156e305
Corrected JSON typo on setban of net.cpp (Sev)fa5b249
Bugfix: Allow building libbitcoinconsensus without any univalue (Luke Dashjr)8b0bdd3
configure: Allow building bench_bitcoin by itself (Luke Dashjr)749c8a5
[doc] typos, READMEs, comments (Justin Camarena)fc34928
Do diskspace check before import thread is started (Pieter Wuille)3b354d2
Add extra message to avoid a long 'Loading banlist' (Pieter Wuille)30eac2d
Use a signal to continue init after genesis activation (Pieter Wuille)9b00979
Update README.md (Chris Stewart)8bb1efd
[qa] Rework hd wallet dump test (MarcoFalke)a7aa3cc
Enable size accounting in mining unit tests (Suhas Daftuar)bea02dc
[qa]: enable rpcbind_test (whythat)e111904
[qa]: add parsing for '<host>:<port>' argument form to rpc_url() (whythat)69d1cd2
net: Ignore `notfound` P2P messages (Wladimir J. van der Laan)f70be14
[QA] Add walletdump RPC test (including HD- & encryption-tests) (Jonas Schnelli)1f21d16
prepend license statement to indirectmap (Kaz Wesley)03b0196
Fix obvious assignment/equality error in test (Jeremy Rubin)8a7d7ff
update name of file bitcoin.qrc (Gaurav Rana)147003c
Add configure check for -latomic (Anthony Towns)091cdeb
Clear witness with vin/vout in CWallet::CreateTransaction() (Suhas Daftuar)8e03382
[Qt][CoinControl] fix UI bug that could result in paying unexpected fee (Jonas Schnelli)6b07362
Fix SIGHASH_SINGLE bug in test_framework SignatureHash (Johnson Lau)a114a02
p2psegwit.py transaction is rejected due to premature witness not size (instagibbs)3606b6b
Update p2p-segwit.py to reflect correct AskFor behavior (instagibbs)733760a
Update btcdrak signing key (BtcDrak)c6a6291
add witness address to address book (instagibbs)
Wladimir J. van der Laan
8 years ago
70 changed files with 535 additions and 283 deletions
@ -0,0 +1,40 @@ |
|||||||
|
# Some versions of gcc/libstdc++ require linking with -latomic if |
||||||
|
# using the C++ atomic library. |
||||||
|
# |
||||||
|
# Sourced from http://bugs.debian.org/797228 |
||||||
|
|
||||||
|
m4_define([_CHECK_ATOMIC_testbody], [[ |
||||||
|
#include <atomic> |
||||||
|
#include <cstdint> |
||||||
|
|
||||||
|
int main() { |
||||||
|
std::atomic<int64_t> a{}; |
||||||
|
|
||||||
|
int64_t v = 5; |
||||||
|
int64_t r = a.fetch_add(v); |
||||||
|
return static_cast<int>(r); |
||||||
|
} |
||||||
|
]]) |
||||||
|
|
||||||
|
AC_DEFUN([CHECK_ATOMIC], [ |
||||||
|
|
||||||
|
AC_LANG_PUSH(C++) |
||||||
|
|
||||||
|
AC_MSG_CHECKING([whether std::atomic can be used without link library]) |
||||||
|
|
||||||
|
AC_LINK_IFELSE([AC_LANG_SOURCE([_CHECK_ATOMIC_testbody])],[ |
||||||
|
AC_MSG_RESULT([yes]) |
||||||
|
],[ |
||||||
|
AC_MSG_RESULT([no]) |
||||||
|
LIBS="$LIBS -latomic" |
||||||
|
AC_MSG_CHECKING([whether std::atomic needs -latomic]) |
||||||
|
AC_LINK_IFELSE([AC_LANG_SOURCE([_CHECK_ATOMIC_testbody])],[ |
||||||
|
AC_MSG_RESULT([yes]) |
||||||
|
],[ |
||||||
|
AC_MSG_RESULT([no]) |
||||||
|
AC_MSG_FAILURE([cannot figure our how to use std::atomic]) |
||||||
|
]) |
||||||
|
]) |
||||||
|
|
||||||
|
AC_LANG_POP |
||||||
|
]) |
Binary file not shown.
@ -0,0 +1,104 @@ |
|||||||
|
#!/usr/bin/env python3 |
||||||
|
# Copyright (c) 2016 The Bitcoin Core developers |
||||||
|
# Distributed under the MIT software license, see the accompanying |
||||||
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php. |
||||||
|
|
||||||
|
from test_framework.test_framework import BitcoinTestFramework |
||||||
|
from test_framework.util import (start_nodes, start_node, assert_equal, bitcoind_processes) |
||||||
|
|
||||||
|
|
||||||
|
def read_dump(file_name, addrs, hd_master_addr_old): |
||||||
|
""" |
||||||
|
Read the given dump, count the addrs that match, count change and reserve. |
||||||
|
Also check that the old hd_master is inactive |
||||||
|
""" |
||||||
|
with open(file_name) as inputfile: |
||||||
|
found_addr = 0 |
||||||
|
found_addr_chg = 0 |
||||||
|
found_addr_rsv = 0 |
||||||
|
hd_master_addr_ret = None |
||||||
|
for line in inputfile: |
||||||
|
# only read non comment lines |
||||||
|
if line[0] != "#" and len(line) > 10: |
||||||
|
# split out some data |
||||||
|
key_label, comment = line.split("#") |
||||||
|
# key = key_label.split(" ")[0] |
||||||
|
keytype = key_label.split(" ")[2] |
||||||
|
if len(comment) > 1: |
||||||
|
addr_keypath = comment.split(" addr=")[1] |
||||||
|
addr = addr_keypath.split(" ")[0] |
||||||
|
keypath = None |
||||||
|
if keytype == "inactivehdmaster=1": |
||||||
|
# ensure the old master is still available |
||||||
|
assert(hd_master_addr_old == addr) |
||||||
|
elif keytype == "hdmaster=1": |
||||||
|
# ensure we have generated a new hd master key |
||||||
|
assert(hd_master_addr_old != addr) |
||||||
|
hd_master_addr_ret = addr |
||||||
|
else: |
||||||
|
keypath = addr_keypath.rstrip().split("hdkeypath=")[1] |
||||||
|
|
||||||
|
# count key types |
||||||
|
for addrObj in addrs: |
||||||
|
if addrObj['address'] == addr and addrObj['hdkeypath'] == keypath and keytype == "label=": |
||||||
|
found_addr += 1 |
||||||
|
break |
||||||
|
elif keytype == "change=1": |
||||||
|
found_addr_chg += 1 |
||||||
|
break |
||||||
|
elif keytype == "reserve=1": |
||||||
|
found_addr_rsv += 1 |
||||||
|
break |
||||||
|
return found_addr, found_addr_chg, found_addr_rsv, hd_master_addr_ret |
||||||
|
|
||||||
|
|
||||||
|
class WalletDumpTest(BitcoinTestFramework): |
||||||
|
|
||||||
|
def __init__(self): |
||||||
|
super().__init__() |
||||||
|
self.setup_clean_chain = False |
||||||
|
self.num_nodes = 1 |
||||||
|
self.extra_args = [["-keypool=90"]] |
||||||
|
|
||||||
|
def setup_network(self, split=False): |
||||||
|
self.nodes = start_nodes(self.num_nodes, self.options.tmpdir, self.extra_args) |
||||||
|
|
||||||
|
def run_test (self): |
||||||
|
tmpdir = self.options.tmpdir |
||||||
|
|
||||||
|
# generate 20 addresses to compare against the dump |
||||||
|
test_addr_count = 20 |
||||||
|
addrs = [] |
||||||
|
for i in range(0,test_addr_count): |
||||||
|
addr = self.nodes[0].getnewaddress() |
||||||
|
vaddr= self.nodes[0].validateaddress(addr) #required to get hd keypath |
||||||
|
addrs.append(vaddr) |
||||||
|
# Should be a no-op: |
||||||
|
self.nodes[0].keypoolrefill() |
||||||
|
|
||||||
|
# dump unencrypted wallet |
||||||
|
self.nodes[0].dumpwallet(tmpdir + "/node0/wallet.unencrypted.dump") |
||||||
|
|
||||||
|
found_addr, found_addr_chg, found_addr_rsv, hd_master_addr_unenc = \ |
||||||
|
read_dump(tmpdir + "/node0/wallet.unencrypted.dump", addrs, None) |
||||||
|
assert_equal(found_addr, test_addr_count) # all keys must be in the dump |
||||||
|
assert_equal(found_addr_chg, 50) # 50 blocks where mined |
||||||
|
assert_equal(found_addr_rsv, 90 + 1) # keypool size (TODO: fix off-by-one) |
||||||
|
|
||||||
|
#encrypt wallet, restart, unlock and dump |
||||||
|
self.nodes[0].encryptwallet('test') |
||||||
|
bitcoind_processes[0].wait() |
||||||
|
self.nodes[0] = start_node(0, self.options.tmpdir, self.extra_args[0]) |
||||||
|
self.nodes[0].walletpassphrase('test', 10) |
||||||
|
# Should be a no-op: |
||||||
|
self.nodes[0].keypoolrefill() |
||||||
|
self.nodes[0].dumpwallet(tmpdir + "/node0/wallet.encrypted.dump") |
||||||
|
|
||||||
|
found_addr, found_addr_chg, found_addr_rsv, hd_master_addr_enc = \ |
||||||
|
read_dump(tmpdir + "/node0/wallet.encrypted.dump", addrs, hd_master_addr_unenc) |
||||||
|
assert_equal(found_addr, test_addr_count) |
||||||
|
assert_equal(found_addr_chg, 90 + 1 + 50) # old reserve keys are marked as change now |
||||||
|
assert_equal(found_addr_rsv, 90 + 1) # keypool size (TODO: fix off-by-one) |
||||||
|
|
||||||
|
if __name__ == '__main__': |
||||||
|
WalletDumpTest().main () |
Loading…
Reference in new issue