File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -138,7 +138,7 @@ impl BitcoinNode {
138
138
}
139
139
140
140
fn spawn ( config : & BitcoinConfig ) -> Result < SpawnOutput > {
141
- let args = config. args ( ) ;
141
+ let args = config. local_args ( ) ;
142
142
debug ! ( "Running bitcoind with args : {args:?}" ) ;
143
143
144
144
info ! (
Original file line number Diff line number Diff line change @@ -46,9 +46,7 @@ impl BitcoinConfig {
46
46
"-regtest" . to_string( ) ,
47
47
format!( "-datadir={}" , self . data_dir. display( ) ) ,
48
48
format!( "-port={}" , self . p2p_port) ,
49
- format!( "-bind=0.0.0.0:{}" , self . p2p_port) ,
50
49
format!( "-rpcport={}" , self . rpc_port) ,
51
- format!( "-bind=0.0.0.0:{}" , self . rpc_port) ,
52
50
format!( "-rpcuser={}" , self . rpc_user) ,
53
51
format!( "-rpcpassword={}" , self . rpc_password) ,
54
52
"-server" . to_string( ) ,
@@ -68,6 +66,19 @@ impl BitcoinConfig {
68
66
]
69
67
. concat ( )
70
68
}
69
+
70
+ /// Args to use whe running local bitcoind node
71
+ /// This prevents odd port conflict when assigning rpc/p2p ports
72
+ pub fn local_args ( & self ) -> Vec < String > {
73
+ [
74
+ self . base_args ( ) ,
75
+ vec ! [
76
+ format!( "-bind=0.0.0.0:{}" , self . p2p_port) ,
77
+ format!( "-bind=0.0.0.0:{}" , self . rpc_port) ,
78
+ ] ,
79
+ ]
80
+ . concat ( )
81
+ }
71
82
}
72
83
73
84
impl LogPathProvider for BitcoinConfig {
You can’t perform that action at this time.
0 commit comments