1
0

ln: check if chain tip is stale when receiving HTLC

if so, don't release preimage / don't forward HTLC
This commit is contained in:
SomberNight
2020-04-13 17:04:27 +02:00
parent 12283d625b
commit 54e1520ee4
5 changed files with 58 additions and 20 deletions

View File

@@ -58,6 +58,7 @@ class MockNetwork:
self.channel_db.data_loaded.set()
self.path_finder = LNPathFinder(self.channel_db)
self.tx_queue = tx_queue
self._blockchain = MockBlockchain()
@property
def callback_lock(self):
@@ -70,6 +71,9 @@ class MockNetwork:
def get_local_height(self):
return 0
def blockchain(self):
return self._blockchain
async def broadcast_transaction(self, tx):
if self.tx_queue:
await self.tx_queue.put(tx)
@@ -77,6 +81,16 @@ class MockNetwork:
async def try_broadcasting(self, tx, name):
await self.broadcast_transaction(tx)
class MockBlockchain:
def height(self):
return 0
def is_tip_stale(self):
return False
class MockWallet:
def set_label(self, x, y):
pass