sighash anyonecanpay

This commit is contained in:
Jay Graber 2017-09-08 14:43:32 -07:00
parent 59c2a1c37b
commit 592e26453c
1 changed files with 2 additions and 2 deletions

View File

@ -10,7 +10,7 @@ import bitcoin.rpc
from bitcoin import SelectParams from bitcoin import SelectParams
from bitcoin.core import b2x, lx, b2lx, x, COIN, COutPoint, CMutableTxOut, CMutableTxIn, CMutableTransaction, Hash160, CTransaction from bitcoin.core import b2x, lx, b2lx, x, COIN, COutPoint, CMutableTxOut, CMutableTxIn, CMutableTransaction, Hash160, CTransaction
from bitcoin.base58 import decode from bitcoin.base58 import decode
from bitcoin.core.script import CScript, OP_DUP, OP_IF, OP_ELSE, OP_ENDIF, OP_HASH160, OP_EQUALVERIFY, OP_CHECKSIG, SignatureHash, SIGHASH_ALL, OP_FALSE, OP_DROP, OP_CHECKLOCKTIMEVERIFY, OP_SHA256, OP_TRUE, OP_FALSE from bitcoin.core.script import CScript, OP_DUP, OP_IF, OP_ELSE, OP_ENDIF, OP_HASH160, OP_EQUALVERIFY, OP_CHECKSIG, SignatureHash, SIGHASH_ALL, SIGHASH_ANYONECANPAY, OP_FALSE, OP_DROP, OP_CHECKLOCKTIMEVERIFY, OP_SHA256, OP_TRUE, OP_FALSE
from bitcoin.core.scripteval import VerifyScript, SCRIPT_VERIFY_P2SH from bitcoin.core.scripteval import VerifyScript, SCRIPT_VERIFY_P2SH
from bitcoin.wallet import CBitcoinAddress, CBitcoinSecret, P2SHBitcoinAddress, P2PKHBitcoinAddress from bitcoin.wallet import CBitcoinAddress, CBitcoinSecret, P2SHBitcoinAddress, P2PKHBitcoinAddress
@ -63,7 +63,7 @@ txout = CMutableTxOut(fundtx['amount'] - FEE, refundAddr.to_scriptPubKey())
# Create the unsigned raw transaction. # Create the unsigned raw transaction.
tx = CMutableTransaction([txin], [txout]) tx = CMutableTransaction([txin], [txout])
# tx.nLockTime = 2430 # tx.nLockTime = 2430
sighash = SignatureHash(redeemScript, tx, 0, SIGHASH_ALL) sighash = SignatureHash(redeemScript, tx, 0, SIGHASH_ANYONECANPAY)
# privkey = bitcoind.dumpprivkey(refundPubKey) # privkey = bitcoind.dumpprivkey(refundPubKey)
# sig = privkey.sign(sighash) + bytes([SIGHASH_ALL]) # sig = privkey.sign(sighash) + bytes([SIGHASH_ALL])