@@ -108,11 +108,11 @@ def stop_three(self):
108
108
109
109
def erase_three (self ):
110
110
os .remove (os .path .join (
111
- self .nodes [0 ].datadir , 'regtest' , 'wallets' , 'wallet.dat' ))
111
+ self .nodes [0 ].datadir , self . chain , 'wallets' , 'wallet.dat' ))
112
112
os .remove (os .path .join (
113
- self .nodes [1 ].datadir , 'regtest' , 'wallets' , 'wallet.dat' ))
113
+ self .nodes [1 ].datadir , self . chain , 'wallets' , 'wallet.dat' ))
114
114
os .remove (os .path .join (
115
- self .nodes [2 ].datadir , 'regtest' , 'wallets' , 'wallet.dat' ))
115
+ self .nodes [2 ].datadir , self . chain , 'wallets' , 'wallet.dat' ))
116
116
117
117
def run_test (self ):
118
118
self .log .info ("Generating initial blockchain" )
@@ -175,17 +175,21 @@ def run_test(self):
175
175
self .erase_three ()
176
176
177
177
# Start node2 with no chain
178
- shutil .rmtree (os .path .join (self .nodes [2 ].datadir , 'regtest' , 'blocks' ))
178
+ shutil .rmtree (
179
+ os .path .join (
180
+ self .nodes [2 ].datadir ,
181
+ self .chain ,
182
+ 'blocks' ))
179
183
shutil .rmtree (os .path .join (
180
- self .nodes [2 ].datadir , 'regtest' , 'chainstate' ))
184
+ self .nodes [2 ].datadir , self . chain , 'chainstate' ))
181
185
182
186
# Restore wallets from backup
183
187
shutil .copyfile (os .path .join (self .nodes [0 ].datadir , 'wallet.bak' ), os .path .join (
184
- self .nodes [0 ].datadir , 'regtest' , 'wallets' , 'wallet.dat' ))
188
+ self .nodes [0 ].datadir , self . chain , 'wallets' , 'wallet.dat' ))
185
189
shutil .copyfile (os .path .join (self .nodes [1 ].datadir , 'wallet.bak' ), os .path .join (
186
- self .nodes [1 ].datadir , 'regtest' , 'wallets' , 'wallet.dat' ))
190
+ self .nodes [1 ].datadir , self . chain , 'wallets' , 'wallet.dat' ))
187
191
shutil .copyfile (os .path .join (self .nodes [2 ].datadir , 'wallet.bak' ), os .path .join (
188
- self .nodes [2 ].datadir , 'regtest' , 'wallets' , 'wallet.dat' ))
192
+ self .nodes [2 ].datadir , self . chain , 'wallets' , 'wallet.dat' ))
189
193
190
194
self .log .info ("Re-starting nodes" )
191
195
self .start_three ()
@@ -200,9 +204,13 @@ def run_test(self):
200
204
self .erase_three ()
201
205
202
206
# start node2 with no chain
203
- shutil .rmtree (os .path .join (self .nodes [2 ].datadir , 'regtest' , 'blocks' ))
207
+ shutil .rmtree (
208
+ os .path .join (
209
+ self .nodes [2 ].datadir ,
210
+ self .chain ,
211
+ 'blocks' ))
204
212
shutil .rmtree (os .path .join (
205
- self .nodes [2 ].datadir , 'regtest' , 'chainstate' ))
213
+ self .nodes [2 ].datadir , self . chain , 'chainstate' ))
206
214
207
215
self .start_three ()
208
216
@@ -226,11 +234,11 @@ def run_test(self):
226
234
# Backup to source wallet file must fail
227
235
sourcePaths = [
228
236
os .path .join (self .nodes [0 ].datadir ,
229
- 'regtest' , 'wallets' , 'wallet.dat' ),
230
- os .path .join (self .nodes [0 ].datadir , 'regtest' ,
237
+ self . chain , 'wallets' , 'wallet.dat' ),
238
+ os .path .join (self .nodes [0 ].datadir , self . chain ,
231
239
'.' , 'wallets' , 'wallet.dat' ),
232
- os .path .join (self .nodes [0 ].datadir , 'regtest' , 'wallets' , '' ),
233
- os .path .join (self .nodes [0 ].datadir , 'regtest' , 'wallets' )]
240
+ os .path .join (self .nodes [0 ].datadir , self . chain , 'wallets' , '' ),
241
+ os .path .join (self .nodes [0 ].datadir , self . chain , 'wallets' )]
234
242
235
243
for sourcePath in sourcePaths :
236
244
assert_raises_rpc_error (- 4 , "backup failed" ,
0 commit comments