@@ -8,6 +8,8 @@ use std::sync::Arc;
88use stderrlog;
99
1010use crate :: chain:: Network ;
11+ #[ cfg( feature = "liquid" ) ]
12+ use crate :: chain:: Txid ;
1113use crate :: daemon:: CookieGetter ;
1214use crate :: errors:: * ;
1315
@@ -81,6 +83,8 @@ pub struct Config {
8183 pub parent_network : BNetwork ,
8284 #[ cfg( feature = "liquid" ) ]
8385 pub asset_db_path : Option < PathBuf > ,
86+ #[ cfg( feature = "liquid" ) ]
87+ pub initial_issuance_prevtx : Option < Txid > ,
8488
8589 #[ cfg( feature = "electrum-discovery" ) ]
8690 pub electrum_public_hosts : Option < crate :: electrum:: ServerHosts > ,
@@ -295,6 +299,12 @@ impl Config {
295299 . long ( "asset-db-path" )
296300 . help ( "Directory for liquid/elements asset db" )
297301 . takes_value ( true ) ,
302+ )
303+ . arg (
304+ Arg :: with_name ( "initial_issuance_prevtx" )
305+ . long ( "initial-issuance-prevtx" )
306+ . help ( "Custom initial issuance prevtx TXID — the txid spent by the issuance tx's input (required for custom liquid testnets/signets)" )
307+ . takes_value ( true ) ,
298308 ) ;
299309
300310 #[ cfg( feature = "electrum-discovery" ) ]
@@ -334,6 +344,12 @@ impl Config {
334344 #[ cfg( feature = "liquid" ) ]
335345 let asset_db_path = m. value_of ( "asset_db_path" ) . map ( PathBuf :: from) ;
336346
347+ #[ cfg( feature = "liquid" ) ]
348+ let initial_issuance_prevtx = m. value_of ( "initial_issuance_prevtx" ) . map ( |s| {
349+ s. parse :: < Txid > ( )
350+ . expect ( "invalid initial-issuance-prevtx TXID" )
351+ } ) ;
352+
337353 let default_daemon_port = match network_type {
338354 #[ cfg( not( feature = "liquid" ) ) ]
339355 Network :: Bitcoin => 8332 ,
@@ -516,6 +532,8 @@ impl Config {
516532 parent_network,
517533 #[ cfg( feature = "liquid" ) ]
518534 asset_db_path,
535+ #[ cfg( feature = "liquid" ) ]
536+ initial_issuance_prevtx,
519537
520538 #[ cfg( feature = "electrum-discovery" ) ]
521539 electrum_public_hosts,
@@ -524,6 +542,7 @@ impl Config {
524542 #[ cfg( feature = "electrum-discovery" ) ]
525543 tor_proxy : m. value_of ( "tor_proxy" ) . map ( |s| s. parse ( ) . unwrap ( ) ) ,
526544 } ;
545+
527546 eprintln ! ( "{:?}" , config) ;
528547 config
529548 }
0 commit comments