@@ -564,6 +564,9 @@ static void txio_hash_tapleaf_hash(cursor_io *io,
564564 bool is_elements )
565565{
566566 const struct wally_map_item * item ;
567+ #ifndef BUILD_ELEMENTS
568+ (void )is_elements ;
569+ #endif
567570 item = io -> cache ? wally_map_get (io -> cache , tapleaf_script , tapleaf_script_len ) : NULL ;
568571 if (item ) {
569572 hash_bytes (& io -> ctx , item -> value , item -> value_len );
@@ -594,6 +597,9 @@ static int legacy_signature_hash(
594597 const bool sh_none = (sighash & WALLY_SIGHASH_MASK ) == WALLY_SIGHASH_NONE ;
595598 const bool sh_single = (sighash & WALLY_SIGHASH_MASK ) == WALLY_SIGHASH_SINGLE ;
596599 cursor_io io ;
600+ #ifndef BUILD_ELEMENTS
601+ (void )is_elements ;
602+ #endif
597603
598604 /* Note that script can be empty, so we don't check it here */
599605 if (!tx || !values || BYTES_INVALID (script , script_len ) ||
@@ -964,7 +970,6 @@ int wally_tx_get_input_signature_hash(
964970{
965971 size_t is_elements = 0 ;
966972 uint32_t sighash_type = flags & WALLY_SIGTYPE_MASK ;
967- int ret = WALLY_EINVAL ;
968973
969974 if (!tx || !tx -> num_inputs || !tx -> num_outputs || !values ||
970975 BYTES_INVALID (script , script_len ) || key_version > 1 ||
@@ -974,11 +979,11 @@ int wally_tx_get_input_signature_hash(
974979 !flags || (flags & ~SIGTYPE_ALL ) || !bytes_out || len != SHA256_LEN )
975980 return WALLY_EINVAL ;
976981
977- if ((ret = wally_tx_is_elements (tx , & is_elements )) != WALLY_OK )
978- return ret ;
979- #ifndef BUILD_ELEMENTS
980- if (is_elements )
982+ #ifdef BUILD_ELEMENTS
983+ if (wally_tx_is_elements (tx , & is_elements ) != WALLY_OK )
981984 return WALLY_EINVAL ;
985+ #else
986+ (void )is_elements ;
982987#endif
983988
984989 switch (sighash ) {
0 commit comments