aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-04-07 04:21:44 +0800
committerMarcoFalke <falke.marco@gmail.com>2020-04-07 04:21:47 +0800
commitabc145c9a4aef8ec269b7e0a3e9403cff9970fe4 (patch)
tree6d5359bd2ac34ef8997d5bcd2b21f9c75ffadafc
parentc5966a87d1fdd7a98f2baee5b2deddd541fdfb5a (diff)
parentfa2251df5e3471e0d19d5d5c7780d34ee1498cee (diff)
downloadbitcoin-abc145c9a4aef8ec269b7e0a3e9403cff9970fe4.tar.xz
Merge #18543: test: Use one node to avoid a race due to missing sync in rpc_signrawtransaction
fa2251df5e3471e0d19d5d5c7780d34ee1498cee 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 fa2251df5e3471e0d19d5d5c7780d34ee1498cee Tree-SHA512: 9450d216d9989d6c44028ae4b9818790cfb00796e0de22331422f775f74d697bb14ebae0e88dca20c6b641363780da384fe94c708e20fce9cfde929fb343b12f
-rwxr-xr-xtest/functional/rpc_signrawtransaction.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/functional/rpc_signrawtransaction.py b/test/functional/rpc_signrawtransaction.py
index a34abbd41b..17686f3a78 100755
--- a/test/functional/rpc_signrawtransaction.py
+++ b/test/functional/rpc_signrawtransaction.py
@@ -169,7 +169,7 @@ class SignRawTransactionsTest(BitcoinTestFramework):
assert 'complete' in spending_tx_signed
assert_equal(spending_tx_signed['complete'], True)
- # Now try with a P2PKH script as the witnessScript
+ self.log.info('Try with a P2PKH script as the witnessScript')
embedded_addr_info = self.nodes[1].getaddressinfo(self.nodes[1].getnewaddress('', 'legacy'))
embedded_privkey = self.nodes[1].dumpprivkey(embedded_addr_info['address'])
witness_script = embedded_addr_info['scriptPubKey']
@@ -186,9 +186,9 @@ class SignRawTransactionsTest(BitcoinTestFramework):
# Check the signing completed successfully
assert 'complete' in spending_tx_signed
assert_equal(spending_tx_signed['complete'], True)
- self.nodes[1].sendrawtransaction(spending_tx_signed['hex'])
+ self.nodes[0].sendrawtransaction(spending_tx_signed['hex'])
- # Now try with a P2PK script as the witnessScript
+ self.log.info('Try with a P2PK script as the witnessScript')
embedded_addr_info = self.nodes[1].getaddressinfo(self.nodes[1].getnewaddress('', 'legacy'))
embedded_privkey = self.nodes[1].dumpprivkey(embedded_addr_info['address'])
witness_script = CScript([hex_str_to_bytes(embedded_addr_info['pubkey']), OP_CHECKSIG]).hex()
@@ -205,7 +205,7 @@ class SignRawTransactionsTest(BitcoinTestFramework):
# Check the signing completed successfully
assert 'complete' in spending_tx_signed
assert_equal(spending_tx_signed['complete'], True)
- self.nodes[1].sendrawtransaction(spending_tx_signed['hex'])
+ self.nodes[0].sendrawtransaction(spending_tx_signed['hex'])
def run_test(self):
self.successful_signing_test()