New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rpc: prevent spending unconfirmed funds within OpenChannel by default #2059

Merged
merged 2 commits into from Oct 24, 2018

Conversation

Projects
None yet
3 participants
@wpaulino
Collaborator

wpaulino commented Oct 16, 2018

In this commit, we address a slight regression in the defaults provided
by the OpenChannel RPC with regards to spending unconfirmed outputs to
fund funding transactions. We now add a new boolean parameter to
OpenChannelRequest: SpendUnconfirmed. If set, we'll use this to
indicate to the server that the funding transaction of the channel to be
created can spend the wallet's unconfirmed outputs to fund it. This
addition is needed because otherwise, if the caller doesn't specify a
MinConfs parameter to the request, then a default of 0 will be used,
which is not ideal.

@@ -761,6 +761,22 @@ func (r *rpcServer) OpenChannel(in *lnrpc.OpenChannelRequest,
"non-negative number")
}
var minConfs int32

This comment has been minimized.

@halseth

halseth Oct 17, 2018

Collaborator

Doesn't look like it is ever set in the case in.MinConfs > 0

This comment has been minimized.

@wpaulino

wpaulino Oct 18, 2018

Collaborator

Fixed!

@wpaulino wpaulino force-pushed the wpaulino:openchannel-unconfirmed-funds branch from 0736808 to cd802a6 Oct 17, 2018

Show resolved Hide resolved rpcserver.go Outdated
Show resolved Hide resolved rpcserver.go Outdated

wpaulino added some commits Oct 16, 2018

rpc: prevent spending unconfirmed funds within OpenChannel by default
In this commit, we address a slight regression in the defaults provided
by the OpenChannel RPC with regards to spending unconfirmed outputs to
fund funding transactions. We now add a new boolean parameter to
OpenChannelRequest: SpendUnconfirmed. If set, we'll use this to
indicate to the server that the funding transaction of the channel to be
created can spend the wallet's unconfirmed outputs to fund it. This
addition is needed because otherwise, if the caller doesn't specify a
MinConfs parameter to the request, then a default of 0 will be used,
which is not ideal.

@wpaulino wpaulino force-pushed the wpaulino:openchannel-unconfirmed-funds branch from cd802a6 to 16b5f70 Oct 18, 2018

@Roasbeef

LGTM 🚀

@Roasbeef Roasbeef merged commit 1b0d8e8 into lightningnetwork:master Oct 24, 2018

1 of 2 checks passed

coverage/coveralls Coverage decreased (-0.02%) to 55.197%
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@wpaulino wpaulino deleted the wpaulino:openchannel-unconfirmed-funds branch Oct 24, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment