File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -857,10 +857,10 @@ s64 wallet_get_newindex(struct lightningd *ld, enum addrtype addrtype)
857857 return newidx ;
858858}
859859
860- enum addrtype wallet_get_addrtype (struct wallet * wallet , u64 idx )
860+ bool wallet_get_addrtype (struct wallet * wallet , u64 idx ,
861+ enum addrtype * addrtype )
861862{
862863 struct db_stmt * stmt ;
863- enum addrtype type ;
864864
865865 stmt = db_prepare_v2 (wallet -> db ,
866866 SQL ("SELECT addrtype"
@@ -872,12 +872,12 @@ enum addrtype wallet_get_addrtype(struct wallet *wallet, u64 idx)
872872 /* Unknown means prior to v24.11 */
873873 if (!db_step (stmt )) {
874874 tal_free (stmt );
875- return ADDR_P2TR | ADDR_BECH32 ;
875+ return false ;
876876 }
877877
878- type = wallet_addrtype_in_db (db_col_int (stmt , "addrtype" ));
878+ * addrtype = wallet_addrtype_in_db (db_col_int (stmt , "addrtype" ));
879879 tal_free (stmt );
880- return type ;
880+ return true ;
881881}
882882
883883static void wallet_shachain_init (struct wallet * wallet ,
Original file line number Diff line number Diff line change @@ -606,8 +606,12 @@ s64 wallet_get_newindex(struct lightningd *ld, enum addrtype addrtype);
606606 * wallet_get_addrtype - get the address types for this key.
607607 * @wallet: (in) wallet
608608 * @keyidx: what address types we've published.
609+ * @addrtype: filled in if true.
610+ *
611+ * If we don't know, returns false.
609612 */
610- enum addrtype wallet_get_addrtype (struct wallet * w , u64 keyidx );
613+ bool wallet_get_addrtype (struct wallet * wallet , u64 idx ,
614+ enum addrtype * addrtype );
611615
612616/**
613617 * wallet_shachain_add_hash -- wallet wrapper around shachain_add_hash
You can’t perform that action at this time.
0 commit comments