Fix detection of payments.
1. In lnhtlc, sent_in_ctn and failed_in_ctn need to look at the remote ctx, and they need to be called when we receive a revocation, not when we send one. 2. In lnchannel, we use 3 lnworker callbacks: - payment sent/payment failed (called when we receive a revocation) - payment received (called when we send a revocation) 3. Make revoke_current_commitment return a single value. The second value was only used in tests, there is no need to bloat the code with that
This commit is contained in:
@@ -126,6 +126,7 @@ class MockLNWallet:
|
||||
await_payment = LNWallet.await_payment
|
||||
payment_received = LNWallet.payment_received
|
||||
payment_sent = LNWallet.payment_sent
|
||||
payment_failed = LNWallet.payment_failed
|
||||
save_preimage = LNWallet.save_preimage
|
||||
get_preimage = LNWallet.get_preimage
|
||||
_create_route_from_invoice = LNWallet._create_route_from_invoice
|
||||
@@ -134,7 +135,7 @@ class MockLNWallet:
|
||||
_pay = LNWallet._pay
|
||||
force_close_channel = LNWallet.force_close_channel
|
||||
get_first_timestamp = lambda self: 0
|
||||
payment_completed = LNWallet.payment_completed
|
||||
|
||||
|
||||
class MockTransport:
|
||||
def __init__(self, name):
|
||||
|
||||
Reference in New Issue
Block a user