Helper function: create a "chain" of chain_length transactions. The nth transaction in the chain is a child of the n-1th transaction and parent of the n+1th transaction.
(node, first_coin, address, privkeys, chain_length=25)
| 296 | return signedtx_child["hex"] |
| 297 | |
| 298 | def create_raw_chain(node, first_coin, address, privkeys, chain_length=25): |
| 299 | """Helper function: create a "chain" of chain_length transactions. The nth transaction in the |
| 300 | chain is a child of the n-1th transaction and parent of the n+1th transaction. |
| 301 | """ |
| 302 | parent_locking_script = None |
| 303 | txid = first_coin["txid"] |
| 304 | chain_hex = [] |
| 305 | chain_txns = [] |
| 306 | value = first_coin["amount"] |
| 307 | |
| 308 | for _ in range(chain_length): |
| 309 | (tx, txhex, value, parent_locking_script) = make_chain(node, address, privkeys, txid, value, 0, parent_locking_script) |
| 310 | txid = tx.rehash() |
| 311 | chain_hex.append(txhex) |
| 312 | chain_txns.append(tx) |
| 313 | |
| 314 | return (chain_hex, chain_txns) |
| 315 | |
| 316 | def bulk_transaction(tx, node, target_weight, privkeys, prevtxs=None): |
| 317 | """Pad a transaction with extra outputs until it reaches a target weight (or higher). |