lnrpc: ability to spend unconfirmed coins

This commit is contained in:
Tom Kirkpatrick committed 2020-10-01 13:27:03 +01:00
1 parent fd962d322a
commit 73a5f325b6
15 files changed
+1030 -764

No files matched your search

+627 -588
View File
File diff suppressed because it is too large. Load diff
+14
View File
@@ -863,6 +863,13 @@ message SendManyRequest {
// An optional label for the transaction, limited to 500 characters.
string label = 6;
// The minimum number of confirmations each one of your outputs used for
// the transaction must satisfy.
int32 min_confs = 7;
// Whether unconfirmed outputs should be used as inputs for the transaction.
bool spend_unconfirmed = 8;
}
message SendManyResponse {
// The id of the transaction
@@ -893,6 +900,13 @@ message SendCoinsRequest {
// An optional label for the transaction, limited to 500 characters.
string label = 7;
// The minimum number of confirmations each one of your outputs used for
// the transaction must satisfy.
int32 min_confs = 8;
// Whether unconfirmed outputs should be used as inputs for the transaction.
bool spend_unconfirmed = 9;
}
message SendCoinsResponse {
// The transaction ID of the transaction
+20
View File
@@ -5243,6 +5243,16 @@
"label": {
"type": "string",
"description": "An optional label for the transaction, limited to 500 characters."
},
"min_confs": {
"type": "integer",
"format": "int32",
"description": "The minimum number of confirmations each one of your outputs used for\nthe transaction must satisfy."
},
"spend_unconfirmed": {
"type": "boolean",
"format": "boolean",
"description": "Whether unconfirmed outputs should be used as inputs for the transaction."
}
}
},
@@ -5279,6 +5289,16 @@
"label": {
"type": "string",
"description": "An optional label for the transaction, limited to 500 characters."
},
"min_confs": {
"type": "integer",
"format": "int32",
"description": "The minimum number of confirmations each one of your outputs used for\nthe transaction must satisfy."
},
"spend_unconfirmed": {
"type": "boolean",
"format": "boolean",
"description": "Whether unconfirmed outputs should be used as inputs for the transaction."
}
}
},
+36
View File
@@ -2,6 +2,7 @@ package lnrpc
import (
"encoding/hex"
"errors"
"sort"
"github.com/lightningnetwork/lnd/lnwallet"
@@ -52,3 +53,38 @@ func RPCTransactionDetails(txns []*lnwallet.TransactionDetail) *TransactionDetai
return txDetails
}
// ExtractMinConfs extracts the minimum number of confirmations that each
// output used to fund a transaction should satisfy.
func ExtractMinConfs(minConfs int32, spendUnconfirmed bool) (int32, error) {
switch {
// Ensure that the MinConfs parameter is non-negative.
case minConfs < 0:
return 0, errors.New("minimum number of confirmations must " +
"be a non-negative number")
// The transaction should not be funded with unconfirmed outputs
// unless explicitly specified by SpendUnconfirmed. We do this to
// provide sane defaults to the OpenChannel RPC, as otherwise, if the
// MinConfs field isn't explicitly set by the caller, we'll use
// unconfirmed outputs without the caller being aware.
case minConfs == 0 && !spendUnconfirmed:
return 1, nil
// In the event that the caller set MinConfs > 0 and SpendUnconfirmed to
// true, we'll return an error to indicate the conflict.
case minConfs > 0 && spendUnconfirmed:
return 0, errors.New("SpendUnconfirmed set to true with " +
"MinConfs > 0")
// The funding transaction of the new channel to be created can be
// funded with unconfirmed outputs.
case spendUnconfirmed:
return 0, nil
// If none of the above cases matched, we'll return the value set
// explicitly by the caller.
default:
return minConfs, nil
}
}
+113 -92
View File
@@ -626,7 +626,12 @@ type SendOutputsRequest struct {
//A slice of the outputs that should be created in the transaction produced.
Outputs []*signrpc.TxOut `protobuf:"bytes,2,rep,name=outputs,proto3" json:"outputs,omitempty"`
// An optional label for the transaction, limited to 500 characters.
Label string `protobuf:"bytes,3,opt,name=label,proto3" json:"label,omitempty"`
Label string `protobuf:"bytes,3,opt,name=label,proto3" json:"label,omitempty"`
// The minimum number of confirmations each one of your outputs used for
// the transaction must satisfy.
MinConfs int32 `protobuf:"varint,4,opt,name=min_confs,json=minConfs,proto3" json:"min_confs,omitempty"`
// Whether unconfirmed outputs should be used as inputs for the transaction.
SpendUnconfirmed bool `protobuf:"varint,5,opt,name=spend_unconfirmed,json=spendUnconfirmed,proto3" json:"spend_unconfirmed,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
@@ -678,6 +683,20 @@ func (m *SendOutputsRequest) GetLabel() string {
return ""
}
func (m *SendOutputsRequest) GetMinConfs() int32 {
if m != nil {
return m.MinConfs
}
return 0
}
func (m *SendOutputsRequest) GetSpendUnconfirmed() bool {
if m != nil {
return m.SpendUnconfirmed
}
return false
}
type SendOutputsResponse struct {
//
//The serialized transaction sent out on the network.
@@ -1381,97 +1400,99 @@ func init() {
func init() { proto.RegisterFile("walletrpc/walletkit.proto", fileDescriptor_6cc6942ac78249e5) }
var fileDescriptor_6cc6942ac78249e5 = []byte{
// 1428 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0xff, 0x6f, 0xda, 0xc8,
0x12, 0x6f, 0xbe, 0x40, 0x60, 0x0c, 0x84, 0x2c, 0x24, 0xa1, 0x34, 0x6d, 0x52, 0x57, 0xef, 0xbd,
0xe8, 0xbd, 0x96, 0xe8, 0xa5, 0xea, 0xa9, 0xed, 0x49, 0xa7, 0x4b, 0xc0, 0x11, 0x11, 0x04, 0x52,
0x43, 0x1a, 0xf5, 0xee, 0x07, 0xcb, 0xe0, 0x2d, 0xb1, 0x02, 0xb6, 0xbb, 0x5e, 0x8a, 0xf9, 0xed,
0xfe, 0x8a, 0x93, 0xfa, 0x6f, 0xdd, 0x5f, 0x74, 0xda, 0x5d, 0x63, 0xd6, 0x40, 0x7a, 0x3a, 0xe9,
0x7e, 0x8a, 0x77, 0x3e, 0x33, 0x9f, 0x99, 0x9d, 0x99, 0xcc, 0x0e, 0xf0, 0x78, 0x62, 0x0e, 0x87,
0x98, 0x12, 0xaf, 0x7f, 0x22, 0xbe, 0xee, 0x6d, 0x5a, 0xf1, 0x88, 0x4b, 0x5d, 0x94, 0x8e, 0xa0,
0x72, 0x9a, 0x78, 0x7d, 0x21, 0x2d, 0x17, 0x7d, 0x7b, 0xe0, 0x30, 0x75, 0xf6, 0x17, 0x13, 0x21,
0x55, 0x5b, 0x80, 0x9a, 0xb6, 0x4f, 0x6f, 0x1c, 0xdf, 0xc3, 0x0e, 0xd5, 0xf1, 0x97, 0x31, 0xf6,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, 0xb4, 0xb7, 0x20, 0x0f, 0x5d, 0xae,
0x01, 0x0a, 0xf7, 0x28, 0x79, 0x15, 0x93, 0x69, 0x24, 0x79, 0xa9, 0x24, 0xf7, 0xff, 0xb9, 0xf5,
0xab, 0x01, 0x8a, 0xb4, 0x9a, 0xc4, 0xd2, 0xb3, 0xb8, 0x70, 0xc5, 0xd2, 0xb3, 0x6c, 0xa3, 0x69,
0x80, 0x22, 0xed, 0x20, 0x31, 0xb6, 0xc5, 0x95, 0x26, 0xc6, 0xb6, 0x6c, 0x75, 0xd1, 0x21, 0x13,
0x1b, 0x74, 0xb1, 0x64, 0x2f, 0x1b, 0x8d, 0xb1, 0x64, 0x2f, 0x9f, 0x91, 0xbf, 0xc0, 0x66, 0x38,
0x4a, 0xd0, 0x43, 0x49, 0x39, 0x3e, 0xf6, 0x62, 0x11, 0x9b, 0x9b, 0x3c, 0xe8, 0x02, 0x60, 0xd6,
0xc3, 0xd1, 0xfe, 0x3d, 0xad, 0x5d, 0xf0, 0x3c, 0xfe, 0x66, 0xe3, 0x47, 0xbf, 0x41, 0x6e, 0xbe,
0x5f, 0x22, 0x55, 0x36, 0x59, 0xde, 0xaf, 0x4b, 0xcf, 0xbe, 0xa9, 0x23, 0xc8, 0xcf, 0x7e, 0xf8,
0xf5, 0xb8, 0x6f, 0xd3, 0xdb, 0x51, 0xb7, 0xdc, 0x73, 0x87, 0xc7, 0x03, 0xb6, 0xd1, 0x38, 0xb6,
0xd3, 0x77, 0x30, 0x1d, 0xbb, 0xe4, 0xee, 0x78, 0xe0, 0x58, 0xc7, 0x7c, 0xbe, 0x1d, 0x47, 0x5c,
0xdd, 0x04, 0xff, 0xa5, 0xf7, 0xea, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0x49, 0x6e, 0x8a, 0xc5,
0x32, 0x0e, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
+7
View File
@@ -233,6 +233,13 @@ message SendOutputsRequest {
// An optional label for the transaction, limited to 500 characters.
string label = 3;
// The minimum number of confirmations each one of your outputs used for
// the transaction must satisfy.
int32 min_confs = 4;
// Whether unconfirmed outputs should be used as inputs for the transaction.
bool spend_unconfirmed = 5;
}
message SendOutputsResponse {
/*
+10
View File
@@ -877,6 +877,16 @@
"label": {
"type": "string",
"description": "An optional label for the transaction, limited to 500 characters."
},
"min_confs": {
"type": "integer",
"format": "int32",
"description": "The minimum number of confirmations each one of your outputs used for\nthe transaction must satisfy."
},
"spend_unconfirmed": {
"type": "boolean",
"format": "boolean",
"description": "Whether unconfirmed outputs should be used as inputs for the transaction."
}
}
},
+8 -1
View File
@@ -473,6 +473,13 @@ func (w *WalletKit) SendOutputs(ctx context.Context,
})
}
// Then, we'll extract the minimum number of confirmations that each
// output we use to fund the transaction should satisfy.
minConfs, err := lnrpc.ExtractMinConfs(req.MinConfs, req.SpendUnconfirmed)
if err != nil {
return nil, err
}
label, err := labels.ValidateAPI(req.Label)
if err != nil {
return nil, err
@@ -481,7 +488,7 @@ func (w *WalletKit) SendOutputs(ctx context.Context,
// Now that we have the outputs mapped, we can request that the wallet
// attempt to create this transaction.
tx, err := w.cfg.Wallet.SendOutputs(
outputsToCreate, chainfee.SatPerKWeight(req.SatPerKw), label,
outputsToCreate, chainfee.SatPerKWeight(req.SatPerKw), minConfs, label,
)
if err != nil {
return nil, err