|
28 | 28 | OP_HASH160,
|
29 | 29 | OP_RETURN,
|
30 | 30 | OP_TRUE,
|
| 31 | + SIGHASH_ALL, |
| 32 | + sign_input_legacy, |
31 | 33 | )
|
32 | 34 | from test_framework.script_util import (
|
33 | 35 | DUMMY_MIN_OP_RETURN_SCRIPT,
|
@@ -386,5 +388,24 @@ def run_test(self):
|
386 | 388 | maxfeerate=0,
|
387 | 389 | )
|
388 | 390 |
|
| 391 | + self.log.info('Spending a confirmed bare multisig is okay') |
| 392 | + address = self.wallet.get_address() |
| 393 | + tx = tx_from_hex(raw_tx_reference) |
| 394 | + privkey, pubkey = generate_keypair() |
| 395 | + tx.vout[0].scriptPubKey = keys_to_multisig_script([pubkey] * 3, k=1) # Some bare multisig script (1-of-3) |
| 396 | + tx.rehash() |
| 397 | + self.generateblock(node, address, [tx.serialize().hex()]) |
| 398 | + tx_spend = CTransaction() |
| 399 | + tx_spend.vin.append(CTxIn(COutPoint(tx.sha256, 0), b"")) |
| 400 | + tx_spend.vout.append(CTxOut(tx.vout[0].nValue - int(fee*COIN), script_to_p2wsh_script(CScript([OP_TRUE])))) |
| 401 | + tx_spend.rehash() |
| 402 | + sign_input_legacy(tx_spend, 0, tx.vout[0].scriptPubKey, privkey, sighash_type=SIGHASH_ALL) |
| 403 | + tx_spend.vin[0].scriptSig = bytes(CScript([OP_0])) + tx_spend.vin[0].scriptSig |
| 404 | + self.check_mempool_result( |
| 405 | + result_expected=[{'txid': tx_spend.rehash(), 'allowed': True, 'vsize': tx_spend.get_vsize(), 'fees': { 'base': Decimal('0.00000700')}}], |
| 406 | + rawtxs=[tx_spend.serialize().hex()], |
| 407 | + maxfeerate=0, |
| 408 | + ) |
| 409 | + |
389 | 410 | if __name__ == '__main__':
|
390 | 411 | MempoolAcceptanceTest().main()
|
0 commit comments