Skip to content

Commit 125a658

Browse files
committed
Replace print() warning with an assert
Libraries can't be printing stuff to stdout willy-nilly.
1 parent bf3e212 commit 125a658

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

bitcoin/core/script.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,11 +1015,7 @@ def SignatureHash(script, txTo, inIdx, hashtype, amount=None, sigversion=SIGVERS
10151015

10161016
return bitcoin.core.Hash(f.getvalue())
10171017

1018-
if script.is_witness_scriptpubkey():
1019-
print("WARNING: You seem to be attempting to sign a scriptPubKey from an")
1020-
print("WARNING: output with segregated witness. This is NOT the correct")
1021-
print("WARNING: thing to sign. You should pass SignatureHash the corresponding")
1022-
print("WARNING: P2WPKH or P2WSH script instead.")
1018+
assert not script.is_witness_scriptpubkey()
10231019

10241020
(h, err) = RawSignatureHash(script, txTo, inIdx, hashtype)
10251021
if err is not None:

0 commit comments

Comments
 (0)