Skip to content

Commit

Permalink
Merge pull request #332 from lightninglabs/pool-0.5.4
Browse files Browse the repository at this point in the history
Pool 0.5.4
  • Loading branch information
Roasbeef authored Jan 5, 2022
2 parents 7c2268f + 500579a commit 2df6d90
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
21 changes: 11 additions & 10 deletions order/batch_storer.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,17 @@ func (s *batchStorer) StorePendingBatch(batch *Batch) error {
account.IncrementBatchKey(),
)

// The account expiry needs to be updated only when the
// client supports it.
if batch.Version.SupportsAccountExtension() &&
diff.NewExpiry != 0 {

modifiers = append(
modifiers,
account.ExpiryModifier(diff.NewExpiry),
)
}

// The account was fully spent on-chain. We need to wait for the
// batch (spend) TX to be confirmed still.
case auctioneerrpc.AccountDiff_OUTPUT_FULLY_SPENT,
Expand Down Expand Up @@ -127,16 +138,6 @@ func (s *batchStorer) StorePendingBatch(batch *Batch) error {
modifiers, account.LatestTxModifier(batch.BatchTX),
)

// The account expiry needs to be updated only when the client
// supports it.
if batch.Version.SupportsAccountExtension() &&
diff.NewExpiry != 0 {

modifiers = append(
modifiers, account.ExpiryModifier(diff.NewExpiry),
)
}

accountModifiers[idx] = modifiers
}

Expand Down
8 changes: 4 additions & 4 deletions order/rpc_parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import (
"github.com/lightningnetwork/lnd/tor"
)

// OrderParseOption defines a set of functional param options that can be used
// ParseOption defines a set of functional param options that can be used
// to modify our we parse orders based on some optional directives.
type OrderParseOption func(*parseOptions)
type ParseOption func(*parseOptions)

// parseOptions houses the set of functional options used to parse RPC orders.
type parseOptions struct {
Expand All @@ -34,7 +34,7 @@ type ChanTypeSelector func() ChannelType

// WithDefaultChannelType allows a caller to select a default channel type
// based on the version of the lnd node attempting to create the order.
func WithDefaultChannelType(selector ChanTypeSelector) OrderParseOption {
func WithDefaultChannelType(selector ChanTypeSelector) ParseOption {
return func(o *parseOptions) {
o.chanTypeSelector = selector
}
Expand All @@ -48,7 +48,7 @@ func defaultParseOptions() *parseOptions {
// ParseRPCOrder parses the incoming raw RPC order into the go native data
// types used in the order struct.
func ParseRPCOrder(version, leaseDuration uint32,
details *poolrpc.Order, parseOpts ...OrderParseOption) (*Kit, error) {
details *poolrpc.Order, parseOpts ...ParseOption) (*Kit, error) {

opts := defaultParseOptions()
for _, newOpt := range parseOpts {
Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const semanticAlphabet = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqr
const (
appMajor uint = 0
appMinor uint = 5
appPatch uint = 3
appPatch uint = 4

// appPreRelease MUST only contain characters from semanticAlphabet per
// the semantic versioning spec.
Expand Down

0 comments on commit 2df6d90

Please sign in to comment.