mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-01-19 05:45:21 +01:00
lnwallet: send ReservationError for invalid/incompatible reservation
This commit is contained in:
parent
bb63ad7da6
commit
0cbb759d0a
@ -479,8 +479,8 @@ func (l *LightningWallet) InitChannelReservation(
|
|||||||
func (l *LightningWallet) handleFundingReserveRequest(req *initFundingReserveMsg) {
|
func (l *LightningWallet) handleFundingReserveRequest(req *initFundingReserveMsg) {
|
||||||
// It isn't possible to create a channel with zero funds committed.
|
// It isn't possible to create a channel with zero funds committed.
|
||||||
if req.fundingAmount+req.capacity == 0 {
|
if req.fundingAmount+req.capacity == 0 {
|
||||||
req.err <- fmt.Errorf("cannot have channel with zero " +
|
err := ErrZeroCapacity()
|
||||||
"satoshis funded")
|
req.err <- err
|
||||||
req.resp <- nil
|
req.resp <- nil
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -488,9 +488,9 @@ func (l *LightningWallet) handleFundingReserveRequest(req *initFundingReserveMsg
|
|||||||
// If the funding request is for a different chain than the one the
|
// If the funding request is for a different chain than the one the
|
||||||
// wallet is aware of, then we'll reject the request.
|
// wallet is aware of, then we'll reject the request.
|
||||||
if !bytes.Equal(l.Cfg.NetParams.GenesisHash[:], req.chainHash[:]) {
|
if !bytes.Equal(l.Cfg.NetParams.GenesisHash[:], req.chainHash[:]) {
|
||||||
req.err <- fmt.Errorf("unable to create channel reservation "+
|
err := ErrChainMismatch(l.Cfg.NetParams.GenesisHash,
|
||||||
"for chain=%v, wallet is on chain=%v",
|
req.chainHash)
|
||||||
req.chainHash, l.Cfg.NetParams.GenesisHash)
|
req.err <- err
|
||||||
req.resp <- nil
|
req.resp <- nil
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user