File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,22 @@ def successful_signing_test(self):
48
48
# 2) No script verification error occurred
49
49
assert 'errors' not in rawTxSigned
50
50
51
+ # Check that signrawtransaction doesn't blow up on garbage merge attempts
52
+ dummyTxInconsistent = self .nodes [0 ].createrawtransaction ([inputs [0 ]], outputs )
53
+ rawTxUnsigned = self .nodes [0 ].signrawtransaction (rawTx + dummyTxInconsistent , inputs )
54
+
55
+ assert 'complete' in rawTxUnsigned
56
+ assert_equal (rawTxUnsigned ['complete' ], False )
57
+
58
+ # Check that signrawtransaction properly merges unsigned and signed txn, even with garbage in the middle
59
+ rawTxSigned2 = self .nodes [0 ].signrawtransaction (rawTxUnsigned ["hex" ] + dummyTxInconsistent + rawTxSigned ["hex" ], inputs )
60
+
61
+ assert 'complete' in rawTxSigned2
62
+ assert_equal (rawTxSigned2 ['complete' ], True )
63
+
64
+ assert 'errors' not in rawTxSigned2
65
+
66
+
51
67
def script_verification_error_test (self ):
52
68
"""Creates and signs a raw transaction with valid (vin 0), invalid (vin 1) and one missing (vin 2) input script.
53
69
You can’t perform that action at this time.
0 commit comments