1
0

psbt: allow insecure signing of legacy UTXOs without full previous tx

When "importing" a psbt, we accept witness utxos even for legacy inputs
(warning shown to user in gui).
When "exporting" a psbt, we follow the spec; except when exporting as a QR code,
in which case we include witness utxos for all inputs.
This makes QR codes for psbts with legacy inputs feasible, just like they
were before, with our custom tx serialization format (with the same risk,
of burning coins as miner fees).
This commit is contained in:
SomberNight
2019-11-07 02:40:10 +01:00
parent 74a46689d8
commit aa518c0ea5
5 changed files with 84 additions and 12 deletions

View File

@@ -1,4 +1,5 @@
from pprint import pprint
import unittest
from electrum import constants
from electrum.transaction import (tx_from_any, PartialTransaction, BadHeaderMagic, UnexpectedEndOfStream,
@@ -223,6 +224,7 @@ class TestInvalidPSBT(TestCaseForTestnet):
class TestPSBTSignerChecks(TestCaseForTestnet):
# test cases from BIP-0174
@unittest.skip("the check this test is testing is intentionally disabled in transaction.py")
def test_psbt_fails_signer_checks_001(self):
# Case: A Witness UTXO is provided for a non-witness input
with self.assertRaises(PSBTInputConsistencyFailure):