Return one-input, one-output transaction object spending the prevtx's n-th output with the given amount. Can optionally pass scriptPubKey and scriptSig, default is anyone-can-spend output.
(prevtx, n, script_sig=b"", *, amount, output_script=None)
| 203 | return coinbase |
| 204 | |
| 205 | def create_tx_with_script(prevtx, n, script_sig=b"", *, amount, output_script=None): |
| 206 | """Return one-input, one-output transaction object |
| 207 | spending the prevtx's n-th output with the given amount. |
| 208 | |
| 209 | Can optionally pass scriptPubKey and scriptSig, default is anyone-can-spend output. |
| 210 | """ |
| 211 | if output_script is None: |
| 212 | output_script = CScript() |
| 213 | tx = CTransaction() |
| 214 | assert n < len(prevtx.vout) |
| 215 | tx.vin.append(CTxIn(COutPoint(prevtx.txid_int, n), script_sig, SEQUENCE_FINAL)) |
| 216 | tx.vout.append(CTxOut(amount, output_script)) |
| 217 | return tx |
| 218 | |
| 219 | def get_legacy_sigopcount_block(block, accurate=True): |
| 220 | count = 0 |
no test coverage detected