mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-23 06:35:07 +01:00
funding: add method IsPendingChannel
This commit is contained in:
parent
7252dbd934
commit
f1f1a38663
1 changed files with 16 additions and 0 deletions
|
@ -2639,6 +2639,22 @@ func (f *fundingManager) getReservationCtx(peerKey *btcec.PublicKey,
|
||||||
return resCtx, nil
|
return resCtx, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// IsPendingChannel returns a boolean indicating whether the channel identified
|
||||||
|
// by the pendingChanID and given peer is pending, meaning it is in the process
|
||||||
|
// of being funded. After the funding transaction has been confirmed, the
|
||||||
|
// channel will receive a new, permanent channel ID, and will no longer be
|
||||||
|
// considered pending.
|
||||||
|
func (f *fundingManager) IsPendingChannel(pendingChanID [32]byte,
|
||||||
|
peerAddress *lnwire.NetAddress) bool {
|
||||||
|
|
||||||
|
peerIDKey := newSerializedKey(peerAddress.IdentityKey)
|
||||||
|
f.resMtx.RLock()
|
||||||
|
_, ok := f.activeReservations[peerIDKey][pendingChanID]
|
||||||
|
f.resMtx.RUnlock()
|
||||||
|
|
||||||
|
return ok
|
||||||
|
}
|
||||||
|
|
||||||
func copyPubKey(pub *btcec.PublicKey) *btcec.PublicKey {
|
func copyPubKey(pub *btcec.PublicKey) *btcec.PublicKey {
|
||||||
return &btcec.PublicKey{
|
return &btcec.PublicKey{
|
||||||
Curve: btcec.S256(),
|
Curve: btcec.S256(),
|
||||||
|
|
Loading…
Add table
Reference in a new issue