1
0

Merge pull request #7152 from bitromortac/2103-liquidity-hints

Liquidity hints for pathfinding
This commit is contained in:
ghost43
2021-04-22 14:45:41 +00:00
committed by GitHub
11 changed files with 548 additions and 149 deletions

View File

@@ -1360,16 +1360,3 @@ class OnionFailureCodeMetaFlag(IntFlag):
UPDATE = 0x1000
class ChannelBlackList:
def __init__(self):
self.blacklist = dict() # short_chan_id -> timestamp
def add(self, short_channel_id: ShortChannelID):
now = int(time.time())
self.blacklist[short_channel_id] = now
def get_current_list(self) -> Set[ShortChannelID]:
BLACKLIST_DURATION = 3600
now = int(time.time())
return set(k for k, t in self.blacklist.items() if now - t < BLACKLIST_DURATION)