rpcserver: add self-node check in OpenChannelSync
This commit is contained in:
parent
303d441d4d
commit
c1f9c56e5b
@ -1867,6 +1867,12 @@ func (r *rpcServer) OpenChannelSync(ctx context.Context,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Making a channel to ourselves wouldn't be of any use, so we
|
||||||
|
// explicitly disallow them.
|
||||||
|
if nodePubKey.IsEqual(r.server.identityPriv.PubKey()) {
|
||||||
|
return nil, fmt.Errorf("cannot open channel to self")
|
||||||
|
}
|
||||||
|
|
||||||
localFundingAmt := btcutil.Amount(in.LocalFundingAmount)
|
localFundingAmt := btcutil.Amount(in.LocalFundingAmount)
|
||||||
remoteInitialBalance := btcutil.Amount(in.PushSat)
|
remoteInitialBalance := btcutil.Amount(in.PushSat)
|
||||||
minHtlcIn := lnwire.MilliSatoshi(in.MinHtlcMsat)
|
minHtlcIn := lnwire.MilliSatoshi(in.MinHtlcMsat)
|
||||||
|
Loading…
Reference in New Issue
Block a user