Skip to content

Commit abc145c

Browse files
author
MarcoFalke
committed
Merge #18543: test: Use one node to avoid a race due to missing sync in rpc_signrawtransaction
fa2251d test: Use one node to avoid a race due to missing sync in rpc_signrawtransaction (MarcoFalke) Pull request description: Node 0 creates a transaction in a block, and node 1 sends a spending transaction without properly syncing the utxo set. Fixes intermittent test failure in rpc_signrawtransaction ``` test 2020-04-01T00:14:03.400000Z TestFramework (ERROR): JSONRPC error Traceback (most recent call last): File "C:\projects\bitcoin\test\functional\test_framework\test_framework.py", line 112, in main self.run_test() File "C:\projects\bitcoin/test/functional/rpc_signrawtransaction.py", line 213, in run_test self.witness_script_test() File "C:\projects\bitcoin/test/functional/rpc_signrawtransaction.py", line 208, in witness_script_test self.nodes[1].sendrawtransaction(spending_tx_signed['hex']) File "C:\projects\bitcoin\test\functional\test_framework\coverage.py", line 47, in __call__ return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs) File "C:\projects\bitcoin\test\functional\test_framework\authproxy.py", line 141, in __call__ raise JSONRPCException(response['error'], status) test_framework.authproxy.JSONRPCException: bad-txns-inputs-missingorspent (-25) ``` Full log: https://ci.appveyor.com/project/DrahtBot/bitcoin/builds/31864368 ACKs for top commit: achow101: ACK fa2251d Tree-SHA512: 9450d216d9989d6c44028ae4b9818790cfb00796e0de22331422f775f74d697bb14ebae0e88dca20c6b641363780da384fe94c708e20fce9cfde929fb343b12f
2 parents c5966a8 + fa2251d commit abc145c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/functional/rpc_signrawtransaction.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def witness_script_test(self):
169169
assert 'complete' in spending_tx_signed
170170
assert_equal(spending_tx_signed['complete'], True)
171171

172-
# Now try with a P2PKH script as the witnessScript
172+
self.log.info('Try with a P2PKH script as the witnessScript')
173173
embedded_addr_info = self.nodes[1].getaddressinfo(self.nodes[1].getnewaddress('', 'legacy'))
174174
embedded_privkey = self.nodes[1].dumpprivkey(embedded_addr_info['address'])
175175
witness_script = embedded_addr_info['scriptPubKey']
@@ -186,9 +186,9 @@ def witness_script_test(self):
186186
# Check the signing completed successfully
187187
assert 'complete' in spending_tx_signed
188188
assert_equal(spending_tx_signed['complete'], True)
189-
self.nodes[1].sendrawtransaction(spending_tx_signed['hex'])
189+
self.nodes[0].sendrawtransaction(spending_tx_signed['hex'])
190190

191-
# Now try with a P2PK script as the witnessScript
191+
self.log.info('Try with a P2PK script as the witnessScript')
192192
embedded_addr_info = self.nodes[1].getaddressinfo(self.nodes[1].getnewaddress('', 'legacy'))
193193
embedded_privkey = self.nodes[1].dumpprivkey(embedded_addr_info['address'])
194194
witness_script = CScript([hex_str_to_bytes(embedded_addr_info['pubkey']), OP_CHECKSIG]).hex()
@@ -205,7 +205,7 @@ def witness_script_test(self):
205205
# Check the signing completed successfully
206206
assert 'complete' in spending_tx_signed
207207
assert_equal(spending_tx_signed['complete'], True)
208-
self.nodes[1].sendrawtransaction(spending_tx_signed['hex'])
208+
self.nodes[0].sendrawtransaction(spending_tx_signed['hex'])
209209

210210
def run_test(self):
211211
self.successful_signing_test()

0 commit comments

Comments
 (0)