@@ -72,7 +72,7 @@ fn main() -> Result<(), Error> {
72
72
73
73
fn init ( config : & Config ) -> Result < ( ) , Error > {
74
74
use bitcoin:: secp256k1:: Secp256k1 ;
75
- use bitcoin:: util:: bip32:: { DerivationPath , ExtendedPrivKey } ;
75
+ use bitcoin:: util:: bip32:: { ChildNumber , DerivationPath , ExtendedPrivKey } ;
76
76
use bitcoin_hd:: {
77
77
SegmentIndexes , TerminalStep , TrackingAccount , UnhardenedIndex ,
78
78
} ;
@@ -154,11 +154,23 @@ fn init(config: &Config) -> Result<(), Error> {
154
154
LNP_NODE_FUNDING_WALLET ,
155
155
"creating" . action( )
156
156
) ;
157
+ let account_path = & [ 10046_u16 , 0 , 2 ] [ ..] ;
158
+ let node_xpriv = signing_account. account_xpriv ( ) ;
159
+ let account_xpriv = node_xpriv. derive_priv (
160
+ & secp,
161
+ & account_path
162
+ . iter ( )
163
+ . copied ( )
164
+ . map ( u32:: from)
165
+ . map ( ChildNumber :: from_hardened_idx)
166
+ . collect :: < Result < Vec < _ > , _ > > ( )
167
+ . expect ( "hardcoded derivation indexes" ) ,
168
+ ) ?;
157
169
let account = TrackingAccount :: with (
158
170
& secp,
159
171
* signing_account. master_id ( ) ,
160
- * signing_account . account_xpriv ( ) ,
161
- & [ 10046 , 0 , 2 ] ,
172
+ account_xpriv,
173
+ account_path ,
162
174
vec ! [ TerminalStep :: range( 0u16 , 1u16 ) , TerminalStep :: Wildcard ] ,
163
175
) ;
164
176
let wallet_data = WalletData {
0 commit comments