File tree Expand file tree Collapse file tree 3 files changed +35
-2
lines changed
Expand file tree Collapse file tree 3 files changed +35
-2
lines changed Original file line number Diff line number Diff line change 6868 'decodescript.py' ,
6969 'p2p-fullblocktest.py' ,
7070 'blockchain.py' ,
71+ 'disablewallet.py' ,
7172]
7273testScriptsExt = [
7374 'bip65-cltv.py' ,
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python2
2+ # Copyright (c) 2014 The Bitcoin Core developers
3+ # Distributed under the MIT software license, see the accompanying
4+ # file COPYING or http://www.opensource.org/licenses/mit-license.php.
5+
6+ #
7+ # Exercise API with -disablewallet.
8+ #
9+
10+ from test_framework .test_framework import BitcoinTestFramework
11+ from test_framework .util import *
12+
13+ class DisableWalletTest (BitcoinTestFramework ):
14+
15+ def setup_chain (self ):
16+ print ("Initializing test directory " + self .options .tmpdir )
17+ initialize_chain_clean (self .options .tmpdir , 1 )
18+
19+ def setup_network (self , split = False ):
20+ self .nodes = start_nodes (1 , self .options .tmpdir , [['-disablewallet' ]])
21+ self .is_network_split = False
22+ self .sync_all ()
23+
24+ def run_test (self ):
25+ # Check regression: https://github.com/bitcoin/bitcoin/issues/6963#issuecomment-154548880
26+ x = self .nodes [0 ].validateaddress ('3J98t1WpEZ73CNmQviecrnyiWrnqRhWNLy' )
27+ assert (x ['isvalid' ] == False )
28+ x = self .nodes [0 ].validateaddress ('mneYUmWYsuk7kySiURxCi3AGxrAqZxLgPZ' )
29+ assert (x ['isvalid' ] == True )
30+
31+ if __name__ == '__main__' :
32+ DisableWalletTest ().main ()
Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ class DescribeAddressVisitor : public boost::static_visitor<UniValue>
117117 UniValue obj (UniValue::VOBJ);
118118 CPubKey vchPubKey;
119119 obj.push_back (Pair (" isscript" , false ));
120- if (pwalletMain->GetPubKey (keyID, vchPubKey)) {
120+ if (pwalletMain && pwalletMain ->GetPubKey (keyID, vchPubKey)) {
121121 obj.push_back (Pair (" pubkey" , HexStr (vchPubKey)));
122122 obj.push_back (Pair (" iscompressed" , vchPubKey.IsCompressed ()));
123123 }
@@ -128,7 +128,7 @@ class DescribeAddressVisitor : public boost::static_visitor<UniValue>
128128 UniValue obj (UniValue::VOBJ);
129129 CScript subscript;
130130 obj.push_back (Pair (" isscript" , true ));
131- if (pwalletMain->GetCScript (scriptID, subscript)) {
131+ if (pwalletMain && pwalletMain ->GetCScript (scriptID, subscript)) {
132132 std::vector<CTxDestination> addresses;
133133 txnouttype whichType;
134134 int nRequired;
You can’t perform that action at this time.
0 commit comments