@@ -133,13 +133,7 @@ async fn print_logs(mut log_rx: Receiver<String>, mut warn_rx: UnboundedReceiver
133133
134134#[ tokio:: test]
135135async fn live_reorg ( ) {
136- let rpc_result = start_bitcoind ( false ) ;
137- // If we can't fetch the genesis block then bitcoind is not running. Just exit.
138- if rpc_result. is_err ( ) {
139- println ! ( "Bitcoin Core is not running. Skipping this test..." ) ;
140- return ;
141- }
142- let ( bitcoind, socket_addr) = rpc_result. unwrap ( ) ;
136+ let ( bitcoind, socket_addr) = start_bitcoind ( true ) . unwrap ( ) ;
143137 let rpc = & bitcoind. client ;
144138 let tempdir = tempfile:: TempDir :: new ( ) . unwrap ( ) . into_path ( ) ;
145139 // Mine some blocks
@@ -189,13 +183,7 @@ async fn live_reorg() {
189183
190184#[ tokio:: test]
191185async fn live_reorg_additional_sync ( ) {
192- let rpc_result = start_bitcoind ( false ) ;
193- // If we can't fetch the genesis block then bitcoind is not running. Just exit.
194- if rpc_result. is_err ( ) {
195- println ! ( "Bitcoin Core is not running. Skipping this test..." ) ;
196- return ;
197- }
198- let ( bitcoind, socket_addr) = rpc_result. unwrap ( ) ;
186+ let ( bitcoind, socket_addr) = start_bitcoind ( true ) . unwrap ( ) ;
199187 let rpc = & bitcoind. client ;
200188 let tempdir = tempfile:: TempDir :: new ( ) . unwrap ( ) . into_path ( ) ;
201189 // Mine some blocks
@@ -249,13 +237,7 @@ async fn live_reorg_additional_sync() {
249237
250238#[ tokio:: test]
251239async fn various_client_methods ( ) {
252- let rpc_result = start_bitcoind ( false ) ;
253- // If we can't fetch the genesis block then bitcoind is not running. Just exit.
254- if rpc_result. is_err ( ) {
255- println ! ( "Bitcoin Core is not running. Skipping this test..." ) ;
256- return ;
257- }
258- let ( bitcoind, socket_addr) = rpc_result. unwrap ( ) ;
240+ let ( bitcoind, socket_addr) = start_bitcoind ( true ) . unwrap ( ) ;
259241 let rpc = & bitcoind. client ;
260242 let tempdir = tempfile:: TempDir :: new ( ) . unwrap ( ) . into_path ( ) ;
261243 // Mine a lot of blocks
@@ -289,13 +271,7 @@ async fn various_client_methods() {
289271
290272#[ tokio:: test]
291273async fn stop_reorg_resync ( ) {
292- let rpc_result = start_bitcoind ( true ) ;
293- // If we can't fetch the genesis block then bitcoind is not running. Just exit.
294- if rpc_result. is_err ( ) {
295- println ! ( "Bitcoin Core is not running. Skipping this test..." ) ;
296- return ;
297- }
298- let ( bitcoind, socket_addr) = rpc_result. unwrap ( ) ;
274+ let ( bitcoind, socket_addr) = start_bitcoind ( true ) . unwrap ( ) ;
299275 let rpc = & bitcoind. client ;
300276 let tempdir = tempfile:: TempDir :: new ( ) . unwrap ( ) . into_path ( ) ;
301277 // Mine some blocks.
@@ -376,13 +352,7 @@ async fn stop_reorg_resync() {
376352
377353#[ tokio:: test]
378354async fn stop_reorg_two_resync ( ) {
379- let rpc_result = start_bitcoind ( true ) ;
380- // If we can't fetch the genesis block then bitcoind is not running. Just exit.
381- if rpc_result. is_err ( ) {
382- println ! ( "Bitcoin Core is not running. Skipping this test..." ) ;
383- return ;
384- }
385- let ( bitcoind, socket_addr) = rpc_result. unwrap ( ) ;
355+ let ( bitcoind, socket_addr) = start_bitcoind ( true ) . unwrap ( ) ;
386356 let rpc = & bitcoind. client ;
387357 let tempdir = tempfile:: TempDir :: new ( ) . unwrap ( ) . into_path ( ) ;
388358 // Mine some blocks.
@@ -463,13 +433,7 @@ async fn stop_reorg_two_resync() {
463433
464434#[ tokio:: test]
465435async fn stop_reorg_start_on_orphan ( ) {
466- let rpc_result = start_bitcoind ( true ) ;
467- // If we can't fetch the genesis block then bitcoind is not running. Just exit.
468- if rpc_result. is_err ( ) {
469- println ! ( "Bitcoin Core is not running. Skipping this test..." ) ;
470- return ;
471- }
472- let ( bitcoind, socket_addr) = rpc_result. unwrap ( ) ;
436+ let ( bitcoind, socket_addr) = start_bitcoind ( true ) . unwrap ( ) ;
473437 let rpc = & bitcoind. client ;
474438 let tempdir = tempfile:: TempDir :: new ( ) . unwrap ( ) . into_path ( ) ;
475439 let miner = rpc. new_address ( ) . unwrap ( ) ;
@@ -585,13 +549,7 @@ async fn stop_reorg_start_on_orphan() {
585549#[ tokio:: test]
586550#[ allow( clippy:: collapsible_match) ]
587551async fn halting_download_works ( ) {
588- let rpc_result = start_bitcoind ( true ) ;
589- // If we can't fetch the genesis block then bitcoind is not running. Just exit.
590- if rpc_result. is_err ( ) {
591- println ! ( "Bitcoin Core is not running. Skipping this test..." ) ;
592- return ;
593- }
594- let ( bitcoind, socket_addr) = rpc_result. unwrap ( ) ;
552+ let ( bitcoind, socket_addr) = start_bitcoind ( true ) . unwrap ( ) ;
595553 let rpc = & bitcoind. client ;
596554 let tempdir = tempfile:: TempDir :: new ( ) . unwrap ( ) . into_path ( ) ;
597555
0 commit comments