Skip to content

Commit

Permalink
Merge commit '3da3d28064d2712400f1b579bd4dfa34e04fd227'
Browse files Browse the repository at this point in the history
  • Loading branch information
rockstardev committed May 31, 2024
2 parents 8fca329 + 3da3d28 commit f6f5e31
Show file tree
Hide file tree
Showing 25 changed files with 770 additions and 345 deletions.
10 changes: 7 additions & 3 deletions blockcache/blockcache.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,26 @@ func (bc *BlockCache) GetBlock(hash *chainhash.Hash,
}

// Fetch the block from the chain backends.
block, err := getBlockImpl(hash)
msgBlock, err := getBlockImpl(hash)
if err != nil {
return nil, err
}

// Make a copy of the block so it won't escape to the heap.
msgBlockCopy := msgBlock.Copy()
block := btcutil.NewBlock(msgBlockCopy)

// Add the new block to blockCache. If the Cache is at its maximum
// capacity then the LFU item will be evicted in favour of this new
// block.
_, err = bc.Cache.Put(
*inv, &neutrino.CacheableBlock{
Block: btcutil.NewBlock(block),
Block: block,
},
)
if err != nil {
return nil, err
}

return block, nil
return msgBlockCopy, nil
}
2 changes: 1 addition & 1 deletion build/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const (
AppMinor uint = 17

// AppPatch defines the application patch for this binary.
AppPatch uint = 3
AppPatch uint = 4

// AppPreRelease MUST only contain characters from semanticAlphabet per
// the semantic versioning spec.
Expand Down
7 changes: 7 additions & 0 deletions chainreg/no_chain_backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"errors"
"time"

"github.com/btcsuite/btcd/btcjson"
"github.com/btcsuite/btcd/btcutil"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/wire"
Expand Down Expand Up @@ -213,4 +214,10 @@ func (n *NoChainSource) BackEnd() string {
return noChainBackendName
}

func (n *NoChainSource) TestMempoolAccept([]*wire.MsgTx,
float64) ([]*btcjson.TestMempoolAcceptResult, error) {

return nil, nil
}

var _ chain.Interface = (*NoChainSource)(nil)
11 changes: 10 additions & 1 deletion cmd/lncli/walletrpc_active.go
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,14 @@ var listSweepsCommand = cli.Command{
Name: "verbose",
Usage: "lookup full transaction",
},
cli.IntFlag{
Name: "startheight",
Usage: "The start height to use when fetching " +
"sweeps. If not specified (0), the result " +
"will start from the earliest sweep. If set " +
"to -1 the result will only include " +
"unconfirmed sweeps (at the time of the call).",
},
},
Description: `
Get a list of the hex-encoded transaction ids of every sweep that our
Expand All @@ -431,7 +439,8 @@ func listSweeps(ctx *cli.Context) error {

resp, err := client.ListSweeps(
ctxc, &walletrpc.ListSweepsRequest{
Verbose: ctx.IsSet("verbose"),
Verbose: ctx.IsSet("verbose"),
StartHeight: int32(ctx.Int("startheight")),
},
)
if err != nil {
Expand Down
69 changes: 69 additions & 0 deletions docs/release-notes/release-notes-0.17.4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Release Notes
- [Bug Fixes](#bug-fixes)
- [New Features](#new-features)
- [Functional Enhancements](#functional-enhancements)
- [RPC Additions](#rpc-additions)
- [lncli Additions](#lncli-additions)
- [Improvements](#improvements)
- [Functional Updates](#functional-updates)
- [RPC Updates](#rpc-updates)
- [lncli Updates](#lncli-updates)
- [Breaking Changes](#breaking-changes)
- [Performance Improvements](#performance-improvements)
- [Technical and Architectural Updates](#technical-and-architectural-updates)
- [BOLT Spec Updates](#bolt-spec-updates)
- [Testing](#testing)
- [Database](#database)
- [Code Health](#code-health)
- [Tooling and Documentation](#tooling-and-documentation)

# Bug Fixes

* [Fix the removal of failed
channels](https://github.com/lightningnetwork/lnd/pull/8406). When a pending
channel opening was pruned from memory no more channels were able to be
created nor accepted. This PR fixes this issue and enhances the test suite
for this behavior.

* [Fix](https://github.com/lightningnetwork/lnd/pull/8401) an issue that
caused memory leak for users running `lnd` with `bitcoind.rpcpolling=1`
mode.

* [Fix](https://github.com/lightningnetwork/lnd/pull/8428) an issue for pruned
nodes where the chain sync got lost because fetching of already pruned blocks
from our peers was not garbage collected when the request failed.

* Let the REST proxy [skip TLS
verification](https://github.com/lightningnetwork/lnd/pull/8437) when
connecting to the gRPC server to prevent invalid cert use when the ephemeral
cert (used with the `--tlsencryptkey` flag) expires.

# New Features
## Functional Enhancements
## RPC Additions

* [Allow callers of ListSweeps to specify the start height](
https://github.com/lightningnetwork/lnd/pull/7372).

## lncli Additions

# Improvements
## Functional Updates
## RPC Updates
## lncli Updates
## Code Health
## Breaking Changes
## Performance Improvements

# Technical and Architectural Updates
## BOLT Spec Updates
## Testing
## Database
## Code Health
## Tooling and Documentation

# Contributors (Alphabetical Order)
* Andras Banki-Horvath
* Elle Mouton
* Yong Yu
* ziggie1984
12 changes: 6 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ module github.com/lightningnetwork/lnd
require (
github.com/NebulousLabs/go-upnp v0.0.0-20180202185039-29b680b06c82
github.com/Yawning/aez v0.0.0-20211027044916-e49e68abd344
github.com/btcsuite/btcd v0.23.5-0.20230905170901-80f5a0ffdf36
github.com/btcsuite/btcd v0.24.1-0.20240123000108-62e6af035ec5
github.com/btcsuite/btcd/btcec/v2 v2.3.2
github.com/btcsuite/btcd/btcutil v1.1.4-0.20230904040416-d4f519f5dc05
github.com/btcsuite/btcd/btcutil v1.1.5
github.com/btcsuite/btcd/btcutil/psbt v1.1.8
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.2
github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f
github.com/btcsuite/btcwallet v0.16.10-0.20231129183218-5df09dd43358
github.com/btcsuite/btcwallet v0.16.10-0.20240127010340-16b422a2e8bf
github.com/btcsuite/btcwallet/wallet/txauthor v1.3.2
github.com/btcsuite/btcwallet/wallet/txrules v1.2.0
github.com/btcsuite/btcwallet/walletdb v1.4.0
Expand All @@ -19,7 +19,7 @@ require (
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1
github.com/go-errors/errors v1.0.1
github.com/golang-migrate/migrate/v4 v4.16.1
github.com/gorilla/websocket v1.4.2
github.com/gorilla/websocket v1.5.0
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
github.com/grpc-ecosystem/grpc-gateway/v2 v2.5.0
Expand Down Expand Up @@ -48,7 +48,7 @@ require (
github.com/miekg/dns v1.1.43
github.com/ory/dockertest/v3 v3.10.0
github.com/prometheus/client_golang v1.11.1
github.com/stretchr/testify v1.8.2
github.com/stretchr/testify v1.8.4
github.com/tv42/zbase32 v0.0.0-20160707012821-501572607d02
github.com/urfave/cli v1.22.9
go.etcd.io/etcd/client/pkg/v3 v3.5.7
Expand Down
26 changes: 13 additions & 13 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6r
github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ=
github.com/btcsuite/btcd v0.22.0-beta.0.20220111032746-97732e52810c/go.mod h1:tjmYdS6MLJ5/s0Fj4DbLgSbDHbEqLJrtnHecBFkdz5M=
github.com/btcsuite/btcd v0.22.0-beta.0.20220204213055-eaf0459ff879/go.mod h1:osu7EoKiL36UThEgzYPqdRaxeo0NU8VoXqgcnwpey0g=
github.com/btcsuite/btcd v0.23.0/go.mod h1:0QJIIN1wwIXF/3G/m87gIwGniDMDQqjVn4SZgnFpsYY=
github.com/btcsuite/btcd v0.23.1/go.mod h1:0QJIIN1wwIXF/3G/m87gIwGniDMDQqjVn4SZgnFpsYY=
github.com/btcsuite/btcd v0.23.5-0.20230905170901-80f5a0ffdf36 h1:g/UbZ6iSzcUH9kEvC+rB8UBCqahmt69e8y6nCegczbg=
github.com/btcsuite/btcd v0.23.5-0.20230905170901-80f5a0ffdf36/go.mod h1:0QJIIN1wwIXF/3G/m87gIwGniDMDQqjVn4SZgnFpsYY=
github.com/btcsuite/btcd v0.23.5-0.20231215221805-96c9fd8078fd/go.mod h1:nm3Bko6zh6bWP60UxwoT5LzdGJsQJaPo6HjduXq9p6A=
github.com/btcsuite/btcd v0.24.1-0.20240123000108-62e6af035ec5 h1:8BHBWvtP6kkzvmCpyWEznq4eS0gfLOSVuXLesv413Xs=
github.com/btcsuite/btcd v0.24.1-0.20240123000108-62e6af035ec5/go.mod h1:5C8ChTkl5ejr3WHj8tkQSCmydiMEPB0ZhQhehpq7Dgg=
github.com/btcsuite/btcd/btcec/v2 v2.1.0/go.mod h1:2VzYrv4Gm4apmbVVsSq5bqf1Ec8v56E48Vt0Y/umPgA=
github.com/btcsuite/btcd/btcec/v2 v2.1.1/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE=
github.com/btcsuite/btcd/btcec/v2 v2.1.3/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE=
Expand All @@ -84,19 +84,19 @@ github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY
github.com/btcsuite/btcd/btcutil v1.0.0/go.mod h1:Uoxwv0pqYWhD//tfTiipkxNfdhG9UrLwaeswfjfdF0A=
github.com/btcsuite/btcd/btcutil v1.1.0/go.mod h1:5OapHB7A2hBBWLm48mmw4MOHNJCcUBTwmWH/0Jn8VHE=
github.com/btcsuite/btcd/btcutil v1.1.1/go.mod h1:nbKlBMNm9FGsdvKvu0essceubPiAcI57pYBNnsLAa34=
github.com/btcsuite/btcd/btcutil v1.1.4-0.20230904040416-d4f519f5dc05 h1:aemxF+69pT9sYC5E6Qj71zQVHcF72m0BNcVhCl3/thU=
github.com/btcsuite/btcd/btcutil v1.1.4-0.20230904040416-d4f519f5dc05/go.mod h1:UR7dsSJzJUfMmFiiLlIrMq1lS9jh9EdCV7FStZSnpi0=
github.com/btcsuite/btcd/btcutil v1.1.5 h1:+wER79R5670vs/ZusMTF1yTcRYE5GUsFbdjdisflzM8=
github.com/btcsuite/btcd/btcutil v1.1.5/go.mod h1:PSZZ4UitpLBWzxGd5VGOrLnmOjtPP/a6HaFo12zMs00=
github.com/btcsuite/btcd/btcutil/psbt v1.1.8 h1:4voqtT8UppT7nmKQkXV+T9K8UyQjKOn2z/ycpmJK8wg=
github.com/btcsuite/btcd/btcutil/psbt v1.1.8/go.mod h1:kA6FLH/JfUx++j9pYU0pyu+Z8XGBQuuTmuKYUf6q7/U=
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc=
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc=
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.2 h1:KdUfX2zKommPRa+PD0sWZUyXe9w277ABlgELO7H04IM=
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.2/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc=
github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 h1:59Kx4K6lzOW5w6nFlA0v5+lk/6sjybR934QNHSJZPTQ=
github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc=
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f h1:bAs4lUbRJpnnkd9VhRV3jjAVU7DJVjMaK+IsvSeZvFo=
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA=
github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg=
github.com/btcsuite/btcwallet v0.16.10-0.20231129183218-5df09dd43358 h1:lZUSo6TISHUJQxpn/AniW5gqaN1iRNS87SDWvV3AHfg=
github.com/btcsuite/btcwallet v0.16.10-0.20231129183218-5df09dd43358/go.mod h1:WSKhOJWUmUOHKCKEzdt+jWAHFAE/t4RqVbCwL2pEdiU=
github.com/btcsuite/btcwallet v0.16.10-0.20240127010340-16b422a2e8bf h1:eNjj5R0tKP48NQxDkuKr+C9frZsdzTAemEwu75ZDQg0=
github.com/btcsuite/btcwallet v0.16.10-0.20240127010340-16b422a2e8bf/go.mod h1:LzcW/LYkQLgDufv6Ouw4cOIW0YsY+A60MTtc61/OZTU=
github.com/btcsuite/btcwallet/wallet/txauthor v1.3.2 h1:etuLgGEojecsDOYTII8rYiGHjGyV5xTqsXi+ZQ715UU=
github.com/btcsuite/btcwallet/wallet/txauthor v1.3.2/go.mod h1:Zpk/LOb2sKqwP2lmHjaZT9AdaKsHPSbNLm2Uql5IQ/0=
github.com/btcsuite/btcwallet/wallet/txrules v1.2.0 h1:BtEN5Empw62/RVnZ0VcJaVtVlBijnLlJY+dwjAye2Bg=
Expand Down Expand Up @@ -295,8 +295,8 @@ github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw=
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y=
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho=
Expand Down Expand Up @@ -602,8 +602,8 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww=
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY=
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc=
Expand Down
8 changes: 8 additions & 0 deletions itest/list_on_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -550,4 +550,12 @@ var allTestCases = []*lntest.TestCase{
Name: "update pending open channels",
TestFunc: testUpdateOnPendingOpenChannels,
},
{
Name: "listsweeps",
TestFunc: testListSweeps,
},
{
Name: "fail funding flow psbt",
TestFunc: testPsbtChanFundingFailFlow,
},
}
4 changes: 2 additions & 2 deletions itest/lnd_channel_force_close_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ func channelForceClosureTest(ht *lntest.HarnessTest,

// Check that we can find the commitment sweep in our set of known
// sweeps, using the simple transaction id ListSweeps output.
ht.AssertSweepFound(alice, sweepingTXID.String(), false)
ht.AssertSweepFound(alice, sweepingTXID.String(), false, 0)

// Restart Alice to ensure that she resumes watching the finalized
// commitment sweep txid.
Expand Down Expand Up @@ -952,7 +952,7 @@ func channelForceClosureTest(ht *lntest.HarnessTest,

// Check that we can find the htlc sweep in our set of sweeps using
// the verbose output of the listsweeps output.
ht.AssertSweepFound(alice, htlcSweepTx.Hash().String(), true)
ht.AssertSweepFound(alice, htlcSweepTx.Hash().String(), true, 0)

// The following restart checks to ensure that the nursery store is
// storing the txid of the previously broadcast htlc sweep txn, and that
Expand Down
97 changes: 97 additions & 0 deletions itest/lnd_onchain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -727,3 +727,100 @@ func genAnchorSweep(ht *lntest.HarnessTest,

return btcutil.NewTx(tx)
}

// testListSweeps tests that we are able to:
// - list only those sweeps that are currently in the mempool,
// - list sweeps given a starting block height,
// - list all sweeps.
func testListSweeps(ht *lntest.HarnessTest) {
// Skip this test for neutrino, as it's not aware of mempool
// transactions.
if ht.IsNeutrinoBackend() {
ht.Skipf("skipping ListSweeps test for neutrino backend")
}

// Create nodes so that we start with no funds on the internal wallet.
alice := ht.NewNode("Alice", nil)
bob := ht.NewNode("Bob", nil)

const initialWalletAmt = btcutil.SatoshiPerBitcoin

// Fund Alice with an initial balance.
ht.FundCoins(initialWalletAmt, alice)

// Connect Alice to Bob.
ht.ConnectNodes(alice, bob)

// Open a few channels between Alice and Bob.
var chanPoints []*lnrpc.ChannelPoint
for i := 0; i < 3; i++ {
chanPoint := ht.OpenChannel(
alice, bob, lntest.OpenChannelParams{
Amt: 1e6,
PushAmt: 5e5,
},
)

chanPoints = append(chanPoints, chanPoint)
}

ht.Shutdown(bob)

// Close the first channel and sweep the funds.
ht.ForceCloseChannel(alice, chanPoints[0])

// Jump a block.
ht.MineBlocks(1)

// Get the current block height.
bestBlockRes := ht.Alice.RPC.GetBestBlock(nil)
blockHeight := bestBlockRes.BlockHeight

// Close the second channel and also sweep the funds.
ht.ForceCloseChannel(alice, chanPoints[1])

// Now close the third channel but don't sweep the funds just yet.
closeStream, _ := ht.CloseChannelAssertPending(
alice, chanPoints[2], true,
)

ht.AssertStreamChannelForceClosed(
alice, chanPoints[2], false, closeStream,
)

// Mine enough blocks for the node to sweep its funds from the force
// closed channel. The commit sweep resolver is able to broadcast the
// sweep tx up to one block before the CSV elapses, so wait until
// defaulCSV-1.
ht.MineEmptyBlocks(node.DefaultCSV - 1)

// Now we can expect that the sweep has been broadcast.
pendingTxHash := ht.Miner.AssertNumTxsInMempool(1)

// List all unconfirmed sweeps that alice's node had broadcast.
sweepResp := alice.RPC.ListSweeps(false, -1)
txIDs := sweepResp.GetTransactionIds().TransactionIds

require.Lenf(ht, txIDs, 1, "number of pending sweeps, starting from "+
"height -1")
require.Equal(ht, pendingTxHash[0].String(), txIDs[0])

// Now list sweeps from the closing of the first channel. We should
// only see the sweep from the second channel and the pending one.
sweepResp = alice.RPC.ListSweeps(false, blockHeight)
txIDs = sweepResp.GetTransactionIds().TransactionIds
require.Lenf(ht, txIDs, 2, "number of sweeps, starting from height %d",
blockHeight)

// Finally list all sweeps from the closing of the second channel. We
// should see all sweeps, including the pending one.
sweepResp = alice.RPC.ListSweeps(false, 0)
txIDs = sweepResp.GetTransactionIds().TransactionIds
require.Lenf(ht, txIDs, 3, "number of sweeps, starting from height 0")

// Mine the pending sweep and make sure it is no longer returned.
ht.MineBlocks(1)
sweepResp = alice.RPC.ListSweeps(false, -1)
txIDs = sweepResp.GetTransactionIds().TransactionIds
require.Empty(ht, txIDs, "pending sweep should not be returned")
}
Loading

0 comments on commit f6f5e31

Please sign in to comment.