@@ -710,9 +710,9 @@ bool sqlite3_bind_short_channel_id(sqlite3_stmt *stmt, int col,
710
710
const struct short_channel_id * id )
711
711
{
712
712
char * ser = short_channel_id_to_str (id , id );
713
- sqlite3_bind_blob (stmt , col , ser , strlen (ser ), SQLITE_TRANSIENT );
713
+ int err = sqlite3_bind_blob (stmt , col , ser , strlen (ser ), SQLITE_TRANSIENT );
714
714
tal_free (ser );
715
- return true ;
715
+ return err == SQLITE_OK ;
716
716
}
717
717
718
718
bool sqlite3_column_short_channel_id (sqlite3_stmt * stmt , int col ,
@@ -731,8 +731,8 @@ bool sqlite3_bind_short_channel_id_array(sqlite3_stmt *stmt, int col,
731
731
732
732
/* Handle nulls early. */
733
733
if (!id ) {
734
- sqlite3_bind_null (stmt , col );
735
- return true ;
734
+ int err = sqlite3_bind_null (stmt , col );
735
+ return err == SQLITE_OK ;
736
736
}
737
737
738
738
ser = tal_arr (NULL , u8 , 0 );
@@ -741,10 +741,10 @@ bool sqlite3_bind_short_channel_id_array(sqlite3_stmt *stmt, int col,
741
741
for (i = 0 ; i < num ; ++ i )
742
742
towire_short_channel_id (& ser , & id [i ]);
743
743
744
- sqlite3_bind_blob (stmt , col , ser , tal_count (ser ), SQLITE_TRANSIENT );
744
+ int err = sqlite3_bind_blob (stmt , col , ser , tal_count (ser ), SQLITE_TRANSIENT );
745
745
746
746
tal_free (ser );
747
- return true ;
747
+ return err == SQLITE_OK ;
748
748
}
749
749
struct short_channel_id *
750
750
sqlite3_column_short_channel_id_array (const tal_t * ctx ,
@@ -776,9 +776,9 @@ sqlite3_column_short_channel_id_array(const tal_t *ctx,
776
776
bool sqlite3_bind_tx (sqlite3_stmt * stmt , int col , const struct bitcoin_tx * tx )
777
777
{
778
778
u8 * ser = linearize_tx (NULL , tx );
779
- sqlite3_bind_blob (stmt , col , ser , tal_count (ser ), SQLITE_TRANSIENT );
779
+ int err = sqlite3_bind_blob (stmt , col , ser , tal_count (ser ), SQLITE_TRANSIENT );
780
780
tal_free (ser );
781
- return true ;
781
+ return err == SQLITE_OK ;
782
782
}
783
783
784
784
struct bitcoin_tx * sqlite3_column_tx (const tal_t * ctx , sqlite3_stmt * stmt ,
@@ -795,8 +795,8 @@ bool sqlite3_bind_signature(sqlite3_stmt *stmt, int col,
795
795
u8 buf [64 ];
796
796
ok = secp256k1_ecdsa_signature_serialize_compact (secp256k1_ctx , buf ,
797
797
sig ) == 1 ;
798
- sqlite3_bind_blob (stmt , col , buf , sizeof (buf ), SQLITE_TRANSIENT );
799
- return ok ;
798
+ int err = sqlite3_bind_blob (stmt , col , buf , sizeof (buf ), SQLITE_TRANSIENT );
799
+ return ok && err == SQLITE_OK ;
800
800
}
801
801
802
802
bool sqlite3_column_signature (sqlite3_stmt * stmt , int col ,
@@ -817,8 +817,8 @@ bool sqlite3_bind_pubkey(sqlite3_stmt *stmt, int col, const struct pubkey *pk)
817
817
{
818
818
u8 der [PUBKEY_DER_LEN ];
819
819
pubkey_to_der (der , pk );
820
- sqlite3_bind_blob (stmt , col , der , sizeof (der ), SQLITE_TRANSIENT );
821
- return true ;
820
+ int err = sqlite3_bind_blob (stmt , col , der , sizeof (der ), SQLITE_TRANSIENT );
821
+ return err == SQLITE_OK ;
822
822
}
823
823
824
824
bool sqlite3_bind_pubkey_array (sqlite3_stmt * stmt , int col ,
@@ -829,19 +829,19 @@ bool sqlite3_bind_pubkey_array(sqlite3_stmt *stmt, int col,
829
829
u8 * ders ;
830
830
831
831
if (!pks ) {
832
- sqlite3_bind_null (stmt , col );
833
- return true ;
832
+ int err = sqlite3_bind_null (stmt , col );
833
+ return err == SQLITE_OK ;
834
834
}
835
835
836
836
n = tal_count (pks );
837
837
ders = tal_arr (NULL , u8 , n * PUBKEY_DER_LEN );
838
838
839
839
for (i = 0 ; i < n ; ++ i )
840
840
pubkey_to_der (& ders [i * PUBKEY_DER_LEN ], & pks [i ]);
841
- sqlite3_bind_blob (stmt , col , ders , tal_count (ders ), SQLITE_TRANSIENT );
841
+ int err = sqlite3_bind_blob (stmt , col , ders , tal_count (ders ), SQLITE_TRANSIENT );
842
842
843
843
tal_free (ders );
844
- return true ;
844
+ return err == SQLITE_OK ;
845
845
}
846
846
struct pubkey * sqlite3_column_pubkey_array (const tal_t * ctx ,
847
847
sqlite3_stmt * stmt , int col )
@@ -875,8 +875,8 @@ bool sqlite3_column_preimage(sqlite3_stmt *stmt, int col, struct preimage *dest
875
875
876
876
bool sqlite3_bind_preimage (sqlite3_stmt * stmt , int col , const struct preimage * p )
877
877
{
878
- sqlite3_bind_blob (stmt , col , p , sizeof (struct preimage ), SQLITE_TRANSIENT );
879
- return true ;
878
+ int err = sqlite3_bind_blob (stmt , col , p , sizeof (struct preimage ), SQLITE_TRANSIENT );
879
+ return err == SQLITE_OK ;
880
880
}
881
881
882
882
bool sqlite3_column_sha256 (sqlite3_stmt * stmt , int col , struct sha256 * dest )
@@ -887,8 +887,8 @@ bool sqlite3_column_sha256(sqlite3_stmt *stmt, int col, struct sha256 *dest)
887
887
888
888
bool sqlite3_bind_sha256 (sqlite3_stmt * stmt , int col , const struct sha256 * p )
889
889
{
890
- sqlite3_bind_blob (stmt , col , p , sizeof (struct sha256 ), SQLITE_TRANSIENT );
891
- return true ;
890
+ int err = sqlite3_bind_blob (stmt , col , p , sizeof (struct sha256 ), SQLITE_TRANSIENT );
891
+ return err == SQLITE_OK ;
892
892
}
893
893
894
894
bool sqlite3_column_sha256_double (sqlite3_stmt * stmt , int col , struct sha256_double * dest )
@@ -905,8 +905,8 @@ struct secret *sqlite3_column_secrets(const tal_t *ctx,
905
905
906
906
bool sqlite3_bind_sha256_double (sqlite3_stmt * stmt , int col , const struct sha256_double * p )
907
907
{
908
- sqlite3_bind_blob (stmt , col , p , sizeof (struct sha256_double ), SQLITE_TRANSIENT );
909
- return true ;
908
+ int err = sqlite3_bind_blob (stmt , col , p , sizeof (struct sha256_double ), SQLITE_TRANSIENT );
909
+ return err == SQLITE_OK ;
910
910
}
911
911
912
912
struct json_escaped * sqlite3_column_json_escaped (const tal_t * ctx ,
@@ -920,6 +920,6 @@ struct json_escaped *sqlite3_column_json_escaped(const tal_t *ctx,
920
920
bool sqlite3_bind_json_escaped (sqlite3_stmt * stmt , int col ,
921
921
const struct json_escaped * esc )
922
922
{
923
- sqlite3_bind_text (stmt , col , esc -> s , strlen (esc -> s ), SQLITE_TRANSIENT );
924
- return true ;
923
+ int err = sqlite3_bind_text (stmt , col , esc -> s , strlen (esc -> s ), SQLITE_TRANSIENT );
924
+ return err == SQLITE_OK ;
925
925
}
0 commit comments