OracleLightningNetwork Class

class OracleLightningNetwork.OracleLightningNetwork(channel_graph: ChannelGraph.ChannelGraph)

Bases: ChannelGraph.ChannelGraph

allocate_amount_as_inflight_on_path(attempt: Attempt.Attempt)

allocates amt as in_flights to all channels of the path

property network
remove_channels_with_no_return_channels()
send_onion(attempt: Attempt.Attempt)

Probes the oracle network if the amount of satoshis for this attempt can be sent through the given path in the attempt. If successful, then inflight amounts are placed on the respective oracle channels as well as uncertainty channels, and the Attempt is set to INFLIGHT. If not successful, then the status of the Attempt is set to FAILED and the failing channel is returned

Parameters

attempt – the attempt that is probed

Type

Attempt

Returns

did sending the onion succeed?

Return type

Boolean

Returns

if sending the onion failed, at which channel did it fail

Return type

UncertaintyChannel or None

settle_attempt(attempt: Attempt.Attempt)

receives a payment attempt and adjusts the balances of the OracleChannels and its reverse channels along the path.

settle_attempt should only be called after all send_onions for a payment terminated successfully!

theoretical_maximum_payable_amount(source: str, destination: str, base_fee: int = 0)

Uses the information from the oracle to compute the min-cut between source and destination

This is only useful for experiments and simulations if one wants to know what would be possible to actually send before starting the payment loop