@@ -365,12 +365,7 @@ impl Account {
365
365
acc_store. all_txs . get ( & txid) . ok_or_else ( || Error :: TxNotFound ( txid. to_string ( ) ) ) ?;
366
366
let tx = & txe. tx ;
367
367
let height = acc_store. heights . get ( & txid) . cloned ( ) . flatten ( ) . unwrap_or ( 0 ) ;
368
- let script_pubkey = tx. output_script ( vout) ;
369
- let account_path: DerivationPath = acc_store
370
- . paths
371
- . get ( & script_pubkey)
372
- . ok_or_else ( || Error :: Generic ( "can't find derivation path" . into ( ) ) ) ?
373
- . clone ( ) ;
368
+ let account_path = acc_store. get_path ( & tx. output_script ( vout) ) ?;
374
369
let ( is_internal, pointer) = parse_path ( & account_path) ?;
375
370
let satoshi = tx. output_value ( vout, & acc_store. unblinded ) . unwrap_or_default ( ) ;
376
371
@@ -582,11 +577,7 @@ impl Account {
582
577
info ! ( "input#{} prev_output:{:?}" , i, prev_output) ;
583
578
let prev_tx = acc_store. get_bitcoin_tx ( & prev_output. txid ) ?;
584
579
let out = prev_tx. output [ prev_output. vout as usize ] . clone ( ) ;
585
- let derivation_path: DerivationPath = acc_store
586
- . paths
587
- . get ( & out. script_pubkey . into ( ) )
588
- . ok_or_else ( || Error :: Generic ( "can't find derivation path" . into ( ) ) ) ?
589
- . clone ( ) ;
580
+ let derivation_path = acc_store. get_path ( & out. script_pubkey . into ( ) ) ?;
590
581
info ! (
591
582
"input#{} prev_output:{:?} derivation_path:{:?}" ,
592
583
i, prev_output, derivation_path
@@ -621,11 +612,7 @@ impl Account {
621
612
info ! ( "input#{} prev_output:{:?}" , i, prev_output) ;
622
613
let prev_tx = acc_store. get_liquid_tx ( & prev_output. txid ) ?;
623
614
let out = prev_tx. output [ prev_output. vout as usize ] . clone ( ) ;
624
- let derivation_path: DerivationPath = acc_store
625
- . paths
626
- . get ( & out. script_pubkey . into ( ) )
627
- . ok_or_else ( || Error :: Generic ( "can't find derivation path" . into ( ) ) ) ?
628
- . clone ( ) ;
615
+ let derivation_path = acc_store. get_path ( & out. script_pubkey . into ( ) ) ?;
629
616
630
617
let ( script_sig, witness) = internal_sign_elements (
631
618
& tx,
0 commit comments