Skip to content

Commit 139bc54

Browse files
committed
tx: invert elements check for tx_io to match elsewhere
1 parent 6f7869f commit 139bc54

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/tx_io.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -962,9 +962,11 @@ int wally_tx_get_input_signature_hash(
962962
!flags || (flags & ~SIGTYPE_ALL) || !bytes_out || len != SHA256_LEN)
963963
return WALLY_EINVAL;
964964

965-
#ifdef BUILD_ELEMENTS
966965
if ((ret = wally_tx_is_elements(tx, &is_elements)) != WALLY_OK)
967966
return ret;
967+
#ifndef BUILD_ELEMENTS
968+
if (is_elements)
969+
return WALLY_EINVAL;
968970
#endif
969971

970972
switch (sighash) {
@@ -1017,5 +1019,5 @@ int wally_tx_get_input_signature_hash(
10171019
genesis_blockhash, genesis_blockhash_len,
10181020
sighash, cache, is_elements,
10191021
bytes_out, len);
1020-
return WALLY_EINVAL;
1022+
return WALLY_EINVAL; /* Unknown sighash type */
10211023
}

0 commit comments

Comments
 (0)