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 68
68
'decodescript.py' ,
69
69
'p2p-fullblocktest.py' ,
70
70
'blockchain.py' ,
71
+ 'disablewallet.py' ,
71
72
]
72
73
testScriptsExt = [
73
74
'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>
117
117
UniValue obj (UniValue::VOBJ);
118
118
CPubKey vchPubKey;
119
119
obj.push_back (Pair (" isscript" , false ));
120
- if (pwalletMain->GetPubKey (keyID, vchPubKey)) {
120
+ if (pwalletMain && pwalletMain ->GetPubKey (keyID, vchPubKey)) {
121
121
obj.push_back (Pair (" pubkey" , HexStr (vchPubKey)));
122
122
obj.push_back (Pair (" iscompressed" , vchPubKey.IsCompressed ()));
123
123
}
@@ -128,7 +128,7 @@ class DescribeAddressVisitor : public boost::static_visitor<UniValue>
128
128
UniValue obj (UniValue::VOBJ);
129
129
CScript subscript;
130
130
obj.push_back (Pair (" isscript" , true ));
131
- if (pwalletMain->GetCScript (scriptID, subscript)) {
131
+ if (pwalletMain && pwalletMain ->GetCScript (scriptID, subscript)) {
132
132
std::vector<CTxDestination> addresses;
133
133
txnouttype whichType;
134
134
int nRequired;
You can’t perform that action at this time.
0 commit comments