-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
rpc: prevent spending unconfirmed funds within OpenChannel by default #2059
Conversation
rpcserver.go
Outdated
@@ -761,6 +761,22 @@ func (r *rpcServer) OpenChannel(in *lnrpc.OpenChannelRequest, | |||
"non-negative number") | |||
} | |||
|
|||
var minConfs int32 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't look like it is ever set in the case in.MinConfs > 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
0736808
to
cd802a6
Compare
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.
cd802a6
to
16b5f70
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
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.