Changeset View
Changeset View
Standalone View
Standalone View
test/functional/dbcrash.py
Show First 20 Lines • Show All 216 Lines • ▼ Show 20 Lines | def generate_small_transactions(self, node, count, utxo_list): | ||||
# Sanity check -- if we chose inputs that are too small, skip | # Sanity check -- if we chose inputs that are too small, skip | ||||
continue | continue | ||||
for i in range(3): | for i in range(3): | ||||
tx.vout.append( | tx.vout.append( | ||||
CTxOut(output_amount, hex_str_to_bytes(utxo['scriptPubKey']))) | CTxOut(output_amount, hex_str_to_bytes(utxo['scriptPubKey']))) | ||||
# Sign and send the transaction to get into the mempool | # Sign and send the transaction to get into the mempool | ||||
tx_signed_hex = node.signrawtransaction(ToHex(tx))['hex'] | tx_signed_hex = node.signrawtransactionwithwallet(ToHex(tx))['hex'] | ||||
node.sendrawtransaction(tx_signed_hex) | node.sendrawtransaction(tx_signed_hex) | ||||
num_transactions += 1 | num_transactions += 1 | ||||
def run_test(self): | def run_test(self): | ||||
# Track test coverage statistics | # Track test coverage statistics | ||||
self.restart_counts = [0, 0, 0] # Track the restarts for nodes 0-2 | self.restart_counts = [0, 0, 0] # Track the restarts for nodes 0-2 | ||||
self.crashed_on_restart = 0 # Track count of crashes during recovery | self.crashed_on_restart = 0 # Track count of crashes during recovery | ||||
▲ Show 20 Lines • Show All 73 Lines • Show Last 20 Lines |