mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-28 14:40:51 +02:00
rpc: validate closing channel address in open channel requests
Our OpenChannelRPC was accepting invalid values for the closing address field. If we were able to decode the address we would use it in the script even if the address is for another bitcoin net.
This commit is contained in:
@@ -55,7 +55,7 @@ func newChanAcceptorCtx(t *testing.T, acceptCallCount int,
|
||||
|
||||
testCtx.acceptor = NewRPCAcceptor(
|
||||
testCtx.receiveResponse, testCtx.sendRequest, testTimeout*5,
|
||||
&chaincfg.TestNet3Params, testCtx.quit,
|
||||
&chaincfg.RegressionNetParams, testCtx.quit,
|
||||
)
|
||||
|
||||
return testCtx
|
||||
@@ -162,7 +162,7 @@ func (c *channelAcceptorCtx) queryAndAssert(queries map[*lnwire.OpenChannel]*Cha
|
||||
func TestMultipleAcceptClients(t *testing.T) {
|
||||
testAddr := "bcrt1qwrmq9uca0t3dy9t9wtuq5tm4405r7tfzyqn9pp"
|
||||
testUpfront, err := chancloser.ParseUpfrontShutdownAddress(
|
||||
testAddr, &chaincfg.TestNet3Params,
|
||||
testAddr, &chaincfg.RegressionNetParams,
|
||||
)
|
||||
require.NoError(t, err)
|
||||
|
||||
|
Reference in New Issue
Block a user