File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed
subprojects/gdk_rust/gdk_electrum/src Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -925,8 +925,7 @@ pub fn populate_unspent_from_db(
925
925
return Err ( Error :: Generic ( "vout greater or equal number of outputs" . into ( ) ) ) ;
926
926
}
927
927
let script_pubkey = tx. output_script ( vout) ;
928
- let derivation_path =
929
- cache. paths . get ( & script_pubkey) . ok_or_else ( || Error :: ScriptPubkeyNotFound ) ?;
928
+ let derivation_path = cache. get_path ( & script_pubkey) ?;
930
929
u. user_path = account. get_full_path ( derivation_path) . into ( ) ;
931
930
u. scriptpubkey = script_pubkey;
932
931
}
@@ -938,7 +937,7 @@ pub fn create_tx(
938
937
account : & Account ,
939
938
request : & mut CreateTransaction ,
940
939
) -> Result < TransactionMeta , Error > {
941
- let _ = populate_unspent_from_db ( account, request) ;
940
+ populate_unspent_from_db ( account, request) ? ;
942
941
info ! ( "create_tx {:?}" , request) ;
943
942
944
943
let network = & account. network ;
Original file line number Diff line number Diff line change @@ -468,14 +468,14 @@ impl RawAccountCache {
468
468
pub fn get_bitcoin_tx ( & self , txid : & bitcoin:: Txid ) -> Result < Transaction , Error > {
469
469
match self . all_txs . get ( & txid. into_be ( ) ) . map ( |etx| & etx. tx ) {
470
470
Some ( BETransaction :: Bitcoin ( tx) ) => Ok ( tx. clone ( ) ) ,
471
- _ => Err ( Error :: Generic ( "expected bitcoin tx" . to_string ( ) ) ) ,
471
+ _ => Err ( Error :: TxNotFound ( BETxid :: Bitcoin ( txid . clone ( ) ) ) ) ,
472
472
}
473
473
}
474
474
475
475
pub fn get_liquid_tx ( & self , txid : & elements:: Txid ) -> Result < elements:: Transaction , Error > {
476
476
match self . all_txs . get ( & txid. into_be ( ) ) . map ( |etx| & etx. tx ) {
477
477
Some ( BETransaction :: Elements ( tx) ) => Ok ( tx. clone ( ) ) ,
478
- _ => Err ( Error :: Generic ( "expected liquid tx" . to_string ( ) ) ) ,
478
+ _ => Err ( Error :: TxNotFound ( BETxid :: Elements ( txid . clone ( ) ) ) ) ,
479
479
}
480
480
}
481
481
You can’t perform that action at this time.
0 commit comments