htlcswitch: add usage of queue in channel link

In this commit usage of the pending packet queue have been added.
This queue will consume the downstream packets if state machine return
the error that we do not have enough capacity for htlc in commitment
transaction. Upon receiving settle/fail payment descriptors - add htlc
have been removed, we release the slot, and process pending add htlc
requests.
This commit is contained in:
Andrey Samokhvalov
2017-05-24 18:27:39 +03:00
committed by Olaoluwa Osuntokun
parent 22d90d6b35
commit 7595bee27c
3 changed files with 126 additions and 2 deletions

View File

@ -359,7 +359,7 @@ func (n *threeHopNetwork) makePayment(peers []Peer,
select {
case err := <-errChan:
return invoice, err
case <-time.After(6 * time.Second):
case <-time.After(12 * time.Second):
return invoice, errors.New("htlc was no settled in time")
}
}