Attempt Class
- class Attempt.Attempt(path: List[Channel.Channel], amount: int = 0)
Bases:
object
When sending an amount of sats from sender to receiver, a payment is usually split up and sent across several paths, to increase the probability of being successfully delivered. Each of these paths is referred to as an Attempt. Attempts thus belong to Payments. Central elements of an Attempt are the list of UncertaintyChannels and amount in sats to be sent along this path.
When an Attempt is instantiated, the given amount is allocated to the in_flight amount in the channels of the path in the UncertaintyNetwork and the AttemptStatus is set to PLANNED.
Each attempt is then probed with send_onion on the oracle network to find out, if the amount can be sent successfully from sender to receiver. If successful, the AttemptStatus is set to INFLIGHT. The in_flight amounts remain on the UncertaintyNetwork. Nothing is done by the Attempt instance. If successful, the AttemptStatus is set to FAILED. Then the in_flight amounts are removed from the channels on the UncertaintyNetwork.
- property amount: int
Returns the amount of the attempt.
- Returns
the amount that was tried to send in this Attempt
- Return type
int
- property path: List[Channel.Channel]
Returns the path of the attempt.
- Returns
the list of Channels that the path consists of
- Return type
list[Channel]
- property probability: float
Returns estimated success probability before the attempt
- Returns
estimated success probability before the attempt
- Return type
float
- property routing_fee: int
Returns the accrued routing fee in msat requested for this path.
- Returns
accrued routing fees for this attempt in msat
- Return type
int
- property status: Attempt.AttemptStatus
Returns the status of the attempt.
- Returns
returns the state of the attempt
- Return type
- class Attempt.AttemptStatus(value)
Bases:
enum.Enum
An enumeration.
- ARRIVED = 4
- FAILED = 8
- INFLIGHT = 2
- PLANNED = 1
- SETTLED = 16