Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
JackPiri committed Oct 10, 2023
1 parent 9d10ded commit 262b039
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
7 changes: 3 additions & 4 deletions qa/rpc-tests/checkblockatheight.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,11 @@ def run_test(self):

self.mark_logs(" Node0 generating 1 honest block")
blocks.extend(self.nodes[0].generate(1))
sync_blocks(self.nodes, 1, False, 5)
sync_blocks(self.nodes[0:3])

h_current = self.nodes[1].getblockcount()

# we will perform on attack aimed at reverting from this block (latest generated) upward
# we will perform an attack aimed at reverting from this block (latest generated) upward
h_attacked = h_current
hash_attacked = blocks[-1]
assert hash_attacked == blocks[h_attacked]
Expand Down Expand Up @@ -331,7 +331,7 @@ def run_test(self):

print(" Node0 generating 1 honest block")
blocks.extend(self.nodes[0].generate(1))
sync_blocks(self.nodes[0:2])
sync_blocks(self.nodes[0:3])

# check tx is no more in mempool
assert_equal(self.is_in_mempool(tx_1000, 1), False)
Expand All @@ -348,7 +348,6 @@ def run_test(self):

print(" Node3 generating 3 malicious blocks thus reverting the honest chain once the ntw is joined!")
blocks.extend(self.nodes[3].generate(3))
sync_blocks(self.nodes, limit_loop=5)

self.mark_logs("Joining network")
self.join_network()
Expand Down
1 change: 0 additions & 1 deletion qa/rpc-tests/mempool_size_limit_even_more.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ def setup_chain(self, split=False):
if (USE_SNAPSHOT):
self.import_data_to_data_dir()
os.remove(self.options.tmpdir+'/node0/regtest/debug.log') # make sure that we have only logs from this test
os.remove(self.options.tmpdir+'/node1/regtest/debug.log')
print("Initializing test directory " + self.options.tmpdir)
initialize_chain_clean(self.options.tmpdir, NUMB_OF_NODES)

Expand Down
4 changes: 3 additions & 1 deletion qa/rpc-tests/sc_cert_nonceasing.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,9 @@ def run_test(self):
fwt_amount = Decimal(0.5)
fwd_tx = self.nodes[0].sc_send(
[{'toaddress': "abcd", 'amount': fwt_amount, "scid": scid, "mcReturnAddress": self.nodes[0].getnewaddress()}],
{'minconf': 1} # this minconf is used to make sure that fwd_tx does not depend on cert_2
{'minconf': 102} # this minconf is used to make sure that fwd_tx does not depend on cert_2 ('minconf': 1)
# in addition, since later in the test c0_block is invalidated and fwd_tx is checked for inclusion in the
# mempool, we want to make sure coins mature before c0_block are used (here we are at c0_block+1 height)
)
assert(fwd_tx in self.nodes[0].getrawmempool())

Expand Down

0 comments on commit 262b039

Please sign in to comment.