Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

- integrated the property bee_line_distance to the Channel class #27

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pickhardtpayments/Channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class ChannelFields():
CLTV = 'delay'
FLAGS = 'channel_flags'
SHORT_CHANNEL_ID = 'short_channel_id'
BEE_LINE_DISTANCE = 'bee_line_distance'


class Channel():
Expand Down Expand Up @@ -85,6 +86,10 @@ def flags(self):
@property
def short_channel_id(self):
return self._cln_jsn[ChannelFields.SHORT_CHANNEL_ID]

@property
def bee_line_distance(self):
return self._cln_jsn[ChannelFields.BEE_LINE_DISTANCE]

def __str__(self):
return str(self._cln_jsn)
7 changes: 6 additions & 1 deletion pickhardtpayments/OracleLightningNetwork.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@

class OracleLightningNetwork(ChannelGraph):

def __init__(self, channel_graph: ChannelGraph):
def __init__(self, channel_graph: ChannelGraph, latency):
self._channel_graph = channel_graph
self._latency = latency
self._network = nx.MultiDiGraph()
for src, dest, short_channel_id, channel in channel_graph.network.edges(data="channel", keys=True):
oracle_channel = None
Expand All @@ -33,6 +34,10 @@ def __init__(self, channel_graph: ChannelGraph):
@property
def network(self):
return self._network

@property
def latency(self):
return self._latency

def send_onion(self, path, amt):
for channel in path:
Expand Down