diff --git a/account/manager.go b/account/manager.go index 73ba8ab08..08671a352 100644 --- a/account/manager.go +++ b/account/manager.go @@ -25,6 +25,7 @@ import ( "github.com/lightninglabs/pool/poolscript" "github.com/lightningnetwork/lnd/chainntnfs" "github.com/lightningnetwork/lnd/input" + "github.com/lightningnetwork/lnd/lnrpc/walletrpc" "github.com/lightningnetwork/lnd/lnwallet" "github.com/lightningnetwork/lnd/lnwallet/chainfee" "github.com/lightningnetwork/lnd/lnwallet/chanfunding" @@ -1345,7 +1346,8 @@ func (m *manager) CloseAccount(ctx context.Context, traderKey *btcec.PublicKey, // script was not populated, we'll generate one from the backing lnd // node's wallet. if feeExpr, ok := feeExpr.(*OutputWithFee); ok && feeExpr.PkScript == nil { - addr, err := m.cfg.Wallet.NextAddr(ctx) + changeType := walletrpc.AddressType_WITNESS_PUBKEY_HASH + addr, err := m.cfg.Wallet.NextAddr(ctx, "", changeType, false) if err != nil { return nil, err } @@ -1825,11 +1827,12 @@ coinSelection: // A change output will only exist as long as the remaining amount is // above the network's dust limit. var changeOutput *wire.TxOut - dustLimit := lnwallet.DustLimitForSize( - input.P2WPKHSize, - ) + dustLimit := lnwallet.DustLimitForSize(input.P2WPKHSize) + changeType := walletrpc.AddressType_WITNESS_PUBKEY_HASH if changeAmt >= dustLimit { - addr, err := m.cfg.Wallet.NextAddr(context.Background()) + addr, err := m.cfg.Wallet.NextAddr( + context.Background(), "", changeType, true, + ) if err != nil { releaseInputs() return nil, nil, nil, err diff --git a/account/mock_test.go b/account/mock_test.go index 838ab50de..2e3eba9ad 100644 --- a/account/mock_test.go +++ b/account/mock_test.go @@ -9,8 +9,10 @@ import ( "github.com/btcsuite/btcd/btcec/v2" "github.com/btcsuite/btcd/btcutil" + "github.com/btcsuite/btcd/btcutil/psbt" "github.com/btcsuite/btcd/chaincfg" "github.com/btcsuite/btcd/chaincfg/chainhash" + "github.com/btcsuite/btcd/txscript" "github.com/btcsuite/btcd/wire" "github.com/btcsuite/btcwallet/wtxmgr" "github.com/lightninglabs/lndclient" @@ -19,6 +21,7 @@ import ( "github.com/lightningnetwork/lnd/chainntnfs" "github.com/lightningnetwork/lnd/input" "github.com/lightningnetwork/lnd/keychain" + "github.com/lightningnetwork/lnd/lnrpc/walletrpc" "github.com/lightningnetwork/lnd/lnwallet" "github.com/lightningnetwork/lnd/lnwallet/chainfee" ) @@ -275,7 +278,9 @@ func (w *mockWallet) SendOutputs(ctx context.Context, outputs []*wire.TxOut, return tx, nil } -func (w *mockWallet) NextAddr(ctx context.Context) (btcutil.Address, error) { +func (w *mockWallet) NextAddr(context.Context, string, + walletrpc.AddressType, bool) (btcutil.Address, error) { + pubKeyHash := btcutil.Hash160(testTraderKey.SerializeCompressed()) return btcutil.NewAddressWitnessPubKeyHash( pubKeyHash, &chaincfg.MainNetParams, @@ -346,6 +351,43 @@ func (w *mockWallet) EstimateFeeToP2WSH(_ context.Context, _ btcutil.Amount, return btcutil.Amount(chainfee.FeePerKwFloor), nil } +func (w *mockWallet) FundPsbt(_ context.Context, + req *walletrpc.FundPsbtRequest) (*psbt.Packet, int32, + []*walletrpc.UtxoLease, error) { + + return nil, 0, nil, nil +} + +func (w *mockWallet) SignPsbt(_ context.Context, + packet *psbt.Packet) (*psbt.Packet, error) { + + for idx := range packet.Inputs { + packet.Inputs[idx].PartialSigs = []*psbt.PartialSig{{ + Signature: []byte{ + // A dummy signature must still have the sighash + // flag appended correctly. + 33, 44, 55, 66, byte(txscript.SigHashAll), + }, + }} + } + + return packet, nil +} + +func (w *mockWallet) FinalizePsbt(_ context.Context, packet *psbt.Packet, + account string) (*psbt.Packet, *wire.MsgTx, error) { + + for idx := range packet.UnsignedTx.TxIn { + packet.UnsignedTx.TxIn[idx].Witness = [][]byte{{ + // A dummy signature must still have the sighash flag + // appended correctly. + 33, 44, 55, 66, byte(txscript.SigHashAll), + }} + } + + return packet, packet.UnsignedTx, nil +} + type mockChainNotifier struct { lndclient.ChainNotifierClient diff --git a/auctioneer/client.go b/auctioneer/client.go index 79f5bbaab..2f9079ae9 100644 --- a/auctioneer/client.go +++ b/auctioneer/client.go @@ -1001,7 +1001,9 @@ func (c *Client) readIncomingStream() { // nolint:gocyclo // Read next message from server. msg, err := c.serverStream.Recv() - log.Tracef("Received msg=%#v, err=%v from server", msg, err) + log.Tracef("Received msg=%v, err=%v from server", + poolrpc.PrintMsg(msg), err) + switch { // EOF is the "normal" close signal, meaning the server has // cut its side of the connection. We will only get this during diff --git a/go.mod b/go.mod index f03a5c1ba..8d4b8e419 100644 --- a/go.mod +++ b/go.mod @@ -3,12 +3,13 @@ module github.com/lightninglabs/pool go 1.16 require ( - github.com/btcsuite/btcd v0.22.0-beta.0.20220413172512-bf64c8bdbbbf + github.com/btcsuite/btcd v0.23.1 github.com/btcsuite/btcd/btcec/v2 v2.2.0 github.com/btcsuite/btcd/btcutil v1.1.1 + github.com/btcsuite/btcd/btcutil/psbt v1.1.4 github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f - github.com/btcsuite/btcwallet v0.15.1-0.20220512002839-af5562928b70 + github.com/btcsuite/btcwallet v0.15.1 github.com/btcsuite/btcwallet/wallet/txrules v1.2.0 github.com/btcsuite/btcwallet/wtxmgr v1.5.0 github.com/davecgh/go-spew v1.1.1 @@ -17,13 +18,13 @@ require ( github.com/grpc-ecosystem/grpc-gateway/v2 v2.5.0 github.com/jessevdk/go-flags v1.4.0 github.com/lightninglabs/aperture v0.1.18-beta - github.com/lightninglabs/lndclient v0.15.0-6 + github.com/lightninglabs/lndclient v0.15.0-9 github.com/lightninglabs/pool/auctioneerrpc v1.0.7 github.com/lightninglabs/protobuf-hex-display v1.4.3-hex-display - github.com/lightningnetwork/lnd v0.15.0-beta.rc3 + github.com/lightningnetwork/lnd v0.15.0-beta.rc6 github.com/lightningnetwork/lnd/cert v1.1.1 github.com/lightningnetwork/lnd/tlv v1.0.3 - github.com/lightningnetwork/lnd/tor v1.0.0 + github.com/lightningnetwork/lnd/tor v1.0.1 github.com/stretchr/testify v1.7.1 github.com/urfave/cli v1.22.4 go.etcd.io/bbolt v1.3.6 diff --git a/go.sum b/go.sum index b62753d30..fc1aab8f8 100644 --- a/go.sum +++ b/go.sum @@ -33,9 +33,11 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/Azure/go-ntlmssp v0.0.0-20211209120228-48547f28849e/go.mod h1:chxPXzSsl7ZWRAuOIE23GDNzjWuZquvFlgA8xmpunjU= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/ChrisTrenkamp/goxpath v0.0.0-20210404020558-97928f7e12b6/go.mod h1:nuWgzSkT5PnyOd+272uUmV0dnAnAn42Mk7PiQC5VzN4= github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= github.com/NebulousLabs/fastrand v0.0.0-20181203155948-6fb6489aac4e h1:n+DcnTNkQnHlwpsrHoQtkrJIO7CBx029fw6oR4vIob4= @@ -75,8 +77,9 @@ github.com/btcsuite/btcd v0.22.0-beta.0.20220111032746-97732e52810c/go.mod h1:tj github.com/btcsuite/btcd v0.22.0-beta.0.20220204213055-eaf0459ff879/go.mod h1:osu7EoKiL36UThEgzYPqdRaxeo0NU8VoXqgcnwpey0g= github.com/btcsuite/btcd v0.22.0-beta.0.20220207191057-4dc4ff7963b4/go.mod h1:7alexyj/lHlOtr2PJK7L/+HDJZpcGDn/pAU98r7DY08= github.com/btcsuite/btcd v0.22.0-beta.0.20220316175102-8d5c75c28923/go.mod h1:taIcYprAW2g6Z9S0gGUxyR+zDwimyDMK5ePOX+iJ2ds= -github.com/btcsuite/btcd v0.22.0-beta.0.20220413172512-bf64c8bdbbbf h1:8lTakMpAAOKTe60bNhiEjUDtcZAlrst2MF49ekuA9yI= -github.com/btcsuite/btcd v0.22.0-beta.0.20220413172512-bf64c8bdbbbf/go.mod h1:0QJIIN1wwIXF/3G/m87gIwGniDMDQqjVn4SZgnFpsYY= +github.com/btcsuite/btcd v0.23.0/go.mod h1:0QJIIN1wwIXF/3G/m87gIwGniDMDQqjVn4SZgnFpsYY= +github.com/btcsuite/btcd v0.23.1 h1:IB8cVQcC2X5mHbnfirLG5IZnkWYNTPlLZVrxUYSotbE= +github.com/btcsuite/btcd v0.23.1/go.mod h1:0QJIIN1wwIXF/3G/m87gIwGniDMDQqjVn4SZgnFpsYY= 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= @@ -96,8 +99,8 @@ github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f h1:bAs4lUbRJpnnkd9 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.14.0/go.mod h1:KFR1x3ZH7c31i4qA34XIvcsnhrEBLK1SHli52lN8E54= -github.com/btcsuite/btcwallet v0.15.1-0.20220512002839-af5562928b70 h1:BkEGO61/bSFNr1xlFTMPrVg2Qw83Bs6gJ5r7PBEGBMo= -github.com/btcsuite/btcwallet v0.15.1-0.20220512002839-af5562928b70/go.mod h1:OQ+KZYSjNxxSIya6uWKquZBJgb8sV86njOj1tzsf0WE= +github.com/btcsuite/btcwallet v0.15.1 h1:SKfh/l2Bgz9sJwHZvfiVbZ8Pl3N/8fFcWWXzsAPz9GU= +github.com/btcsuite/btcwallet v0.15.1/go.mod h1:7OFsQ8ypiRwmr67hE0z98uXgJgXGAihE79jCib9x6ag= github.com/btcsuite/btcwallet/wallet/txauthor v1.2.1/go.mod h1:/74bubxX5Js48d76nf/TsNabpYp/gndUuJw4chzCmhU= github.com/btcsuite/btcwallet/wallet/txauthor v1.2.3 h1:M2yr5UlULvpqtxUqpMxTME/pA92Z9cpqeyvAFk9lAg0= github.com/btcsuite/btcwallet/wallet/txauthor v1.2.3/go.mod h1:T2xSiKGpUkSLCh68aF+FMXmKK9mFqNdHl9VaqOr+JjU= @@ -216,8 +219,9 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw= github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/gofrs/uuid v4.2.0+incompatible h1:yyYWMnhkhrKwwr8gAOcOCYxOOscHgDS9yZgBrnJfGa0= +github.com/gofrs/uuid v4.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= @@ -239,6 +243,7 @@ github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -293,6 +298,8 @@ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ 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/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4= +github.com/gorilla/sessions v1.2.1/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM= 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/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= @@ -317,6 +324,7 @@ github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerX github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= @@ -379,6 +387,12 @@ github.com/jackpal/gateway v1.0.5 h1:qzXWUJfuMdlLMtt0a3Dgt+xkWQiA5itDEITVJtuSwMc github.com/jackpal/gateway v1.0.5/go.mod h1:lTpwd4ACLXmpyiCTRtfiNyVnUmqT9RivzCDQetPfnjA= github.com/jackpal/go-nat-pmp v0.0.0-20170405195558-28a68d0c24ad h1:heFfj7z0pGsNCekUlsFhO2jstxO4b5iQ665LjwM5mDc= github.com/jackpal/go-nat-pmp v0.0.0-20170405195558-28a68d0c24ad/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= +github.com/jcmturner/aescts/v2 v2.0.0/go.mod h1:AiaICIRyfYg35RUkr8yESTqvSy7csK90qZ5xfvvsoNs= +github.com/jcmturner/dnsutils/v2 v2.0.0/go.mod h1:b0TnjGOvI/n42bZa+hmXL+kFJZsFT7G4t3HTlQ184QM= +github.com/jcmturner/gofork v1.0.0/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o= +github.com/jcmturner/goidentity/v6 v6.0.1/go.mod h1:X1YW3bgtvwAXju7V3LCIMpY0Gbxyjn/mY9zx4tFonSg= +github.com/jcmturner/gokrb5/v8 v8.4.2/go.mod h1:sb+Xq/fTY5yktf/VxLsE3wlfPqQjp0aWNYyvBVK62bc= +github.com/jcmturner/rpc/v2 v2.0.3/go.mod h1:VUJYCIDm3PVOEHw8sgt091/20OJjskO/YJki3ELg/Hc= github.com/jedib0t/go-pretty/v6 v6.2.7/go.mod h1:FMkOpgGD3EZ91cW8g/96RfxoV7bdeJyzXPYgz1L1ln0= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA= @@ -398,30 +412,43 @@ github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/X github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/juju/ansiterm v0.0.0-20160907234532-b99631de12cf/go.mod h1:UJSiEoRfvx3hP73CvoARgeLjaIOjybY9vj8PUPPFGeU= github.com/juju/ansiterm v0.0.0-20180109212912-720a0952cc2a/go.mod h1:UJSiEoRfvx3hP73CvoARgeLjaIOjybY9vj8PUPPFGeU= -github.com/juju/clock v0.0.0-20190205081909-9c5c9712527c h1:3UvYABOQRhJAApj9MdCN+Ydv841ETSoy6xLzdmmr/9A= +github.com/juju/ansiterm v0.0.0-20210706145210-9283cdf370b5/go.mod h1:UJSiEoRfvx3hP73CvoARgeLjaIOjybY9vj8PUPPFGeU= github.com/juju/clock v0.0.0-20190205081909-9c5c9712527c/go.mod h1:nD0vlnrUjcjJhqN5WuCWZyzfd5AHZAC9/ajvbSx69xA= +github.com/juju/clock v0.0.0-20220202072423-1b0f830854c4/go.mod h1:zDZCPSgCJQINeZtQwHx2/cFk4seaBC8Yiqe8V82xiP0= +github.com/juju/clock v0.0.0-20220203021603-d9deb868a28a h1:Az/6CM/P5guGHNy7r6TkOCctv3lDmN3W1uhku7QMupk= +github.com/juju/clock v0.0.0-20220203021603-d9deb868a28a/go.mod h1:GZ/FY8Cqw3KHG6DwRVPUKbSPTAwyrU28xFi5cqZnLsc= github.com/juju/cmd v0.0.0-20171107070456-e74f39857ca0/go.mod h1:yWJQHl73rdSX4DHVKGqkAip+huBslxRwS8m9CrOLq18= -github.com/juju/collections v0.0.0-20200605021417-0d0ec82b7271 h1:4R626WTwa7pRYQFiIRLVPepMhm05eZMEx+wIurRnMLc= +github.com/juju/cmd/v3 v3.0.0-20220202061353-b1cc80b193b0/go.mod h1:EoGJiEG+vbMwO9l+Es0SDTlaQPjH6nLcnnc4NfZB3cY= github.com/juju/collections v0.0.0-20200605021417-0d0ec82b7271/go.mod h1:5XgO71dV1JClcOJE+4dzdn4HrI5LiyKd7PlVG6eZYhY= +github.com/juju/collections v0.0.0-20220203020748-febd7cad8a7a h1:d7eZO8OS/ZXxdP0uq3E8CdoA1qNFaecAv90UxrxaY2k= +github.com/juju/collections v0.0.0-20220203020748-febd7cad8a7a/go.mod h1:JWeZdyttIEbkR51z2S13+J+aCuHVe0F6meRy+P0YGDo= github.com/juju/errors v0.0.0-20150916125642-1b5e39b83d18/go.mod h1:W54LbzXuIE0boCoNJfwqpmkKJ1O4TCTZMetAt6jGk7Q= github.com/juju/errors v0.0.0-20200330140219-3fe23663418f/go.mod h1:W54LbzXuIE0boCoNJfwqpmkKJ1O4TCTZMetAt6jGk7Q= -github.com/juju/errors v0.0.0-20220203013757-bd733f3c86b9 h1:EJHbsNpQyupmMeWTq7inn+5L/WZ7JfzCVPJ+DP9McCQ= +github.com/juju/errors v0.0.0-20210818161939-5560c4c073ff/go.mod h1:i1eL7XREII6aHpQ2gApI/v6FkVUDEBremNkcBCKYAcY= github.com/juju/errors v0.0.0-20220203013757-bd733f3c86b9/go.mod h1:TRm7EVGA3mQOqSVcBySRY7a9Y1/gyVhh/WTCnc5sD4U= +github.com/juju/errors v0.0.0-20220331221717-b38fca44723b h1:AxFeSQJfcm2O3ov1wqAkTKYFsnMw2g1B4PkYujfAdkY= +github.com/juju/errors v0.0.0-20220331221717-b38fca44723b/go.mod h1:jMGj9DWF/qbo91ODcfJq6z/RYc3FX3taCBZMCcpI4Ls= github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d/go.mod h1:2PavIy+JPciBPrBUjwbNvtwB6RQlve+hkpll6QSNmOE= github.com/juju/httpprof v0.0.0-20141217160036-14bf14c30767/go.mod h1:+MaLYz4PumRkkyHYeXJ2G5g5cIW0sli2bOfpmbaMV/g= github.com/juju/loggo v0.0.0-20170605014607-8232ab8918d9/go.mod h1:vgyd7OREkbtVEN/8IXZe5Ooef3LQePvuBm9UWj6ZL8U= github.com/juju/loggo v0.0.0-20200526014432-9ce3a2e09b5e/go.mod h1:vgyd7OREkbtVEN/8IXZe5Ooef3LQePvuBm9UWj6ZL8U= github.com/juju/loggo v0.0.0-20210728185423-eebad3a902c4 h1:NO5tuyw++EGLnz56Q8KMyDZRwJwWO8jQnj285J3FOmY= github.com/juju/loggo v0.0.0-20210728185423-eebad3a902c4/go.mod h1:NIXFioti1SmKAlKNuUwbMenNdef59IF52+ZzuOmHYkg= -github.com/juju/mgo/v2 v2.0.0-20210302023703-70d5d206e208 h1:/WiCm+Vpj87e4QWuWwPD/bNE9kDrWCLvPBHOQNcG2+A= github.com/juju/mgo/v2 v2.0.0-20210302023703-70d5d206e208/go.mod h1:0OChplkvPTZ174D2FYZXg4IB9hbEwyHkD+zT+/eK+Fg= +github.com/juju/mgo/v2 v2.0.0-20220111072304-f200228f1090 h1:zX5GoH3Jp8k1EjUFkApu/YZAYEn0PYQfg/U6IDyNyYs= +github.com/juju/mgo/v2 v2.0.0-20220111072304-f200228f1090/go.mod h1:N614SE0a4e+ih2rg96Vi2PeC3cTpUOWgCTv3Cgk974c= github.com/juju/mutex v0.0.0-20171110020013-1fe2a4bf0a3a/go.mod h1:Y3oOzHH8CQ0Ppt0oCKJ2JFO81/EsWenH5AEqigLH+yY= +github.com/juju/mutex/v2 v2.0.0-20220128011612-57176ebdcfa3/go.mod h1:TTCG9BJD9rCC4DZFz3jA0QvCqFDHw8Eqz0jstwY7RTQ= +github.com/juju/mutex/v2 v2.0.0-20220203023141-11eeddb42c6c/go.mod h1:jwCfBs/smYDaeZLqeaCi8CB8M+tOes4yf827HoOEoqk= github.com/juju/retry v0.0.0-20151029024821-62c620325291/go.mod h1:OohPQGsr4pnxwD5YljhQ+TZnuVRYpa5irjugL1Yuif4= -github.com/juju/retry v0.0.0-20180821225755-9058e192b216 h1:/eQL7EJQKFHByJe3DeE8Z36yqManj9UY5zppDoQi4FU= github.com/juju/retry v0.0.0-20180821225755-9058e192b216/go.mod h1:OohPQGsr4pnxwD5YljhQ+TZnuVRYpa5irjugL1Yuif4= +github.com/juju/retry v0.0.0-20220204093819-62423bf33287 h1:U+7oMWEglXfiikIppNexButZRwKPlzLBGKYSNCXzXf8= +github.com/juju/retry v0.0.0-20220204093819-62423bf33287/go.mod h1:SssN1eYeK3A2qjnFGTiVMbdzGJ2BfluaJblJXvuvgqA= github.com/juju/testing v0.0.0-20180402130637-44801989f0f7/go.mod h1:63prj8cnj0tU0S9OHjGJn+b1h0ZghCndfnbQolrYTwA= +github.com/juju/testing v0.0.0-20180517134105-72703b1e95eb/go.mod h1:63prj8cnj0tU0S9OHjGJn+b1h0ZghCndfnbQolrYTwA= github.com/juju/testing v0.0.0-20190723135506-ce30eb24acd2/go.mod h1:63prj8cnj0tU0S9OHjGJn+b1h0ZghCndfnbQolrYTwA= github.com/juju/testing v0.0.0-20210302031854-2c7ee8570c07/go.mod h1:7lxZW0B50+xdGFkvhAb8bwAGt6IU87JB1H9w4t8MNVM= +github.com/juju/testing v0.0.0-20210324180055-18c50b0c2098/go.mod h1:7lxZW0B50+xdGFkvhAb8bwAGt6IU87JB1H9w4t8MNVM= github.com/juju/testing v0.0.0-20220202055744-1ad0816210a6/go.mod h1:QgWc2UdIPJ8t3rnvv95tFNOsQDfpXYEZDbP281o3b2c= github.com/juju/testing v0.0.0-20220203020004-a0ff61f03494 h1:XEDzpuZb8Ma7vLja3+5hzUqVTvAqm5Y+ygvnDs5iTMM= github.com/juju/testing v0.0.0-20220203020004-a0ff61f03494/go.mod h1:rUquetT0ALL48LHZhyRGvjjBH8xZaZ8dFClulKK5wK4= @@ -429,14 +456,17 @@ github.com/juju/utils v0.0.0-20180424094159-2000ea4ff043/go.mod h1:6/KLg8Wz/y2KV github.com/juju/utils v0.0.0-20200116185830-d40c2fe10647 h1:wQpkHVbIIpz1PCcLYku9KFWsJ7aEMQXHBBmLy3tRBTk= github.com/juju/utils v0.0.0-20200116185830-d40c2fe10647/go.mod h1:6/KLg8Wz/y2KVGWEpkK9vMNGkOnu4k/cqs8Z1fKjTOk= github.com/juju/utils/v2 v2.0.0-20200923005554-4646bfea2ef1/go.mod h1:fdlDtQlzundleLLz/ggoYinEt/LmnrpNKcNTABQATNI= -github.com/juju/utils/v3 v3.0.0-20220130232349-cd7ecef0e94a h1:5ZWDCeCF0RaITrZGemzmDFIhjR/MVSvBUqgSyaeTMbE= github.com/juju/utils/v3 v3.0.0-20220130232349-cd7ecef0e94a/go.mod h1:LzwbbEN7buYjySp4nqnti6c6olSqRXUk6RkbSUUP1n8= +github.com/juju/utils/v3 v3.0.0-20220202114721-338bb0530e89/go.mod h1:wf5w+8jyTh2IYnSX0sHnMJo4ZPwwuiBWn+xN3DkQg4k= +github.com/juju/utils/v3 v3.0.0-20220203023959-c3fbc78a33b0 h1:bn+2Adl1yWqYjm3KSFlFqsvfLg2eq+XNL7GGMYApdVw= +github.com/juju/utils/v3 v3.0.0-20220203023959-c3fbc78a33b0/go.mod h1:8csUcj1VRkfjNIRzBFWzLFCMLwLqsRWvkmhfVAUwbC4= github.com/juju/version v0.0.0-20161031051906-1f41e27e54f2/go.mod h1:kE8gK5X0CImdr7qpSKl3xB2PmpySSmfj7zVbkZFs81U= github.com/juju/version v0.0.0-20180108022336-b64dbd566305/go.mod h1:kE8gK5X0CImdr7qpSKl3xB2PmpySSmfj7zVbkZFs81U= github.com/juju/version v0.0.0-20191219164919-81c1be00b9a6 h1:nrqc9b4YKpKV4lPI3GPPFbo5FUuxkWxgZE2Z8O4lgaw= github.com/juju/version v0.0.0-20191219164919-81c1be00b9a6/go.mod h1:kE8gK5X0CImdr7qpSKl3xB2PmpySSmfj7zVbkZFs81U= -github.com/juju/version/v2 v2.0.0-20211007103408-2e8da085dc23 h1:wtEPbidt1VyHlb8RSztU6ySQj29FLsOQiI9XiJhXDM4= github.com/juju/version/v2 v2.0.0-20211007103408-2e8da085dc23/go.mod h1:Ljlbryh9sYaUSGXucslAEDf0A2XUSGvDbHJgW8ps6nc= +github.com/juju/version/v2 v2.0.0-20220204124744-fc9915e3d935 h1:6YoyzXVW1XkqN86y2s/rz365Jm7EiAy39v2G5ikzvHU= +github.com/juju/version/v2 v2.0.0-20220204124744-fc9915e3d935/go.mod h1:ZeFjNy+UFEWJDDPdzW7Cm9NeU6dsViGaFYhXzycLQrw= github.com/julienschmidt/httprouter v1.1.1-0.20151013225520-77a895ad01eb/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= @@ -481,19 +511,19 @@ github.com/lightninglabs/gozmq v0.0.0-20191113021534-d20a764486bf h1:HZKvJUHlcXI github.com/lightninglabs/gozmq v0.0.0-20191113021534-d20a764486bf/go.mod h1:vxmQPeIQxPf6Jf9rM8R+B4rKBqLA2AjttNxkFBL2Plk= github.com/lightninglabs/lightning-node-connect/hashmailrpc v1.0.2/go.mod h1:antQGRDRJiuyQF6l+k6NECCSImgCpwaZapATth2Chv4= github.com/lightninglabs/lndclient v0.15.0-0/go.mod h1:ORS/YFe9hAXlzN/Uj+gvTmrnXEml6yD6dWwzCjpTJyQ= -github.com/lightninglabs/lndclient v0.15.0-6 h1:wFNmHtZSV54FzPZsPOX3/rwRIRUlLJLvWB760hzPCag= -github.com/lightninglabs/lndclient v0.15.0-6/go.mod h1:bQrzrVGpBuaM2c6mapsAdbnhsXJydOU6gFAKvevEzgo= +github.com/lightninglabs/lndclient v0.15.0-9 h1:r1IOjnnhBdyDdzqHKI2jw1gEbkkty9zJ3KpVl/i6JxM= +github.com/lightninglabs/lndclient v0.15.0-9/go.mod h1:KqftwAxD1dDGKYB9hrnbFx2BkwA4mxY22cBfTw4GbF0= github.com/lightninglabs/neutrino v0.13.2/go.mod h1:Cv/v8oHiPhuGiGvGgO+rIMhwCwEdsQFu6as840i2afw= -github.com/lightninglabs/neutrino v0.14.1 h1:ALFckeS3CPmWZmX75vxZaWvz2TUebuASH+CR4cqVo18= -github.com/lightninglabs/neutrino v0.14.1/go.mod h1:SV9ccrw2m6t6UvJX8xB//W0Dv+LEwMTbjg4V/Fb5KwU= +github.com/lightninglabs/neutrino v0.14.2 h1:yrnZUCYMZ5ECtXhgDrzqPq2oX8awoAN2D/cgCewJcCo= +github.com/lightninglabs/neutrino v0.14.2/go.mod h1:OICUeTCn+4Tu27YRJIpWvvqySxx4oH4vgdP33Sw9RDc= github.com/lightninglabs/protobuf-hex-display v1.4.3-hex-display h1:RZJ8H4ueU/aQ9pFtx5wqsuD3B/DezrewJeVwDKKYY8E= github.com/lightninglabs/protobuf-hex-display v1.4.3-hex-display/go.mod h1:2oKOBU042GKFHrdbgGiKax4xVrFiZu51lhacUZQ9MnE= github.com/lightningnetwork/lightning-onion v1.0.2-0.20220211021909-bb84a1ccb0c5 h1:TkKwqFcQTGYoI+VEqyxA8rxpCin8qDaYX0AfVRinT3k= github.com/lightningnetwork/lightning-onion v1.0.2-0.20220211021909-bb84a1ccb0c5/go.mod h1:7dDx73ApjEZA0kcknI799m2O5kkpfg4/gr7N092ojNo= github.com/lightningnetwork/lnd v0.14.1-beta.0.20220324135938-0dcaa511a249/go.mod h1:Tp3ZxsfioUl6kQ30RrbMqWoZyZ4K+fv/o1lMEU8U7rA= -github.com/lightningnetwork/lnd v0.15.0-beta.rc1/go.mod h1:NzCE1ZGct0YEW9u74TXUpXp5AoUXzpkI5lgrO7x0ugM= -github.com/lightningnetwork/lnd v0.15.0-beta.rc3 h1:PpKtAPmP7d7NBJZE1OBIBcdhMzw9r6znkQUUj92dTWo= -github.com/lightningnetwork/lnd v0.15.0-beta.rc3/go.mod h1:NzCE1ZGct0YEW9u74TXUpXp5AoUXzpkI5lgrO7x0ugM= +github.com/lightningnetwork/lnd v0.15.0-beta.rc5/go.mod h1:Tm7LZrYeR2JQH1gEOKmd0NTCgjJ1Bnujkx4lcz9b5+A= +github.com/lightningnetwork/lnd v0.15.0-beta.rc6 h1:CY+vmWgfJcdRpDSrklwq+TYFx9JhLMy6CANOPdaKA3o= +github.com/lightningnetwork/lnd v0.15.0-beta.rc6/go.mod h1:Tm7LZrYeR2JQH1gEOKmd0NTCgjJ1Bnujkx4lcz9b5+A= github.com/lightningnetwork/lnd/cert v1.1.1 h1:Nsav0RlIDRbOnzz2Yu69SQlK939IKya3Q2S0mDviIN8= github.com/lightningnetwork/lnd/cert v1.1.1/go.mod h1:1P46svkkd73oSoeI4zjkVKgZNwGq8bkGuPR8z+5vQUs= github.com/lightningnetwork/lnd/clock v1.0.1/go.mod h1:KnQudQ6w0IAMZi1SgvecLZQZ43ra2vpDNj7H/aasemg= @@ -513,26 +543,32 @@ github.com/lightningnetwork/lnd/ticker v1.1.0/go.mod h1:ubqbSVCn6RlE0LazXuBr7/Zi github.com/lightningnetwork/lnd/tlv v1.0.2/go.mod h1:fICAfsqk1IOsC1J7G9IdsWX1EqWRMqEDCNxZJSKr9C4= github.com/lightningnetwork/lnd/tlv v1.0.3 h1:0xBZcPuXagP6f7TY/RnLNR4igE21ov6qUdTr5NyvhhI= github.com/lightningnetwork/lnd/tlv v1.0.3/go.mod h1:dzR/aZetBri+ZY/fHbwV06fNn/3UID6htQzbHfREFdo= -github.com/lightningnetwork/lnd/tor v1.0.0 h1:wvEc7I+Y7IOtPglVP3cVBbYhiVhc7uTd7cMF9gQRzwA= github.com/lightningnetwork/lnd/tor v1.0.0/go.mod h1:RDtaAdwfAm+ONuPYwUhNIH1RAvKPv+75lHPOegUcz64= +github.com/lightningnetwork/lnd/tor v1.0.1 h1:A11FrpU0Y//g+fA827W4VnjOeoIvExONdchlLX8wYkA= +github.com/lightningnetwork/lnd/tor v1.0.1/go.mod h1:RDtaAdwfAm+ONuPYwUhNIH1RAvKPv+75lHPOegUcz64= github.com/ltcsuite/ltcd v0.0.0-20190101042124-f37f8bf35796 h1:sjOGyegMIhvgfq5oaue6Td+hxZuf3tDC8lAPrFldqFw= github.com/ltcsuite/ltcd v0.0.0-20190101042124-f37f8bf35796/go.mod h1:3p7ZTf9V1sNPI5H8P3NkTFF4LuwMdPl2DodF60qAKqY= github.com/ltcsuite/ltcutil v0.0.0-20181217130922-17f3b04680b6/go.mod h1:8Vg/LTOO0KYa/vlHWJ6XZAevPQThGH5sufO0Hrou/lA= github.com/lunixbochs/vtclean v0.0.0-20160125035106-4fbf7632a2c6/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= +github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/masterzen/azure-sdk-for-go v3.2.0-beta.0.20161014135628-ee4f0065d00c+incompatible/go.mod h1:mf8fjOu33zCqxUjuiU3I8S1lJMyEAlH+0F2+M5xl3hE= github.com/masterzen/simplexml v0.0.0-20160608183007-4572e39b1ab9/go.mod h1:kCEbxUJlNDEBNbdQMkPSp6yaKcRXVI6f4ddk8Riv4bc= +github.com/masterzen/simplexml v0.0.0-20190410153822-31eea3082786/go.mod h1:kCEbxUJlNDEBNbdQMkPSp6yaKcRXVI6f4ddk8Riv4bc= github.com/masterzen/winrm v0.0.0-20161014151040-7a535cd943fc/go.mod h1:CfZSN7zwz5gJiFhZJz49Uzk7mEBHIceWmbFmYx7Hf7E= +github.com/masterzen/winrm v0.0.0-20211231115050-232efb40349e/go.mod h1:Iju3u6NzoTAvjuhsGCZc+7fReNnr/Bd6DsWj3WTokIU= github.com/masterzen/xmlpath v0.0.0-20140218185901-13f4951698ad/go.mod h1:A0zPC53iKKKcXYxr4ROjpQRQ5FgJXtelNdSmHHuq/tY= github.com/mattn/go-colorable v0.0.6/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-isatty v0.0.0-20160806122752-66b8e73f3f5c/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.13/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= @@ -676,6 +712,8 @@ github.com/ulikunitz/xz v0.5.10 h1:t92gobL9l3HE202wg3rlk19F6X+JOxl9BBrCCMYEYd8= github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/urfave/cli v1.22.4 h1:u7tSpNPPswAFymm8IehJhy4uJMlUuU/GmqSkvJ1InXA= github.com/urfave/cli v1.22.4/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/xdg-go/stringprep v1.0.2 h1:6iq84/ryjjeRmMJwxutI51F2GIPlP5BfTvXHeYjyhBc= +github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 h1:nIPpBwaJSVYIxUFsDv3M8ofmx9yWTog9BfvIu0q41lo= github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8/go.mod h1:HUYIGzjTL3rfEspMxjDjgmT5uz5wzYJKVo23qUhYTos= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8= @@ -775,11 +813,13 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201112155050-0c6587e931a9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3 h1:0es+/5331RGQPcXlMfP+WrnIIS6dNnNRe0WB02W0F4M= +golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -861,8 +901,11 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f h1:OfiFi4JbukWwe3lzw+xunroH1mnC1e2Gy5cxNJApiSY= +golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211216030914-fe4d6282115f h1:hEYJvxw1lSnWIl8X9ofsYMklzaDs90JI2az5YMd4fPM= +golang.org/x/net v0.0.0-20211216030914-fe4d6282115f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -941,9 +984,11 @@ golang.org/x/sys v0.0.0-20210426080607-c94f62235c83/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= diff --git a/internal/test/mock_interfaces.go b/internal/test/mock_interfaces.go index f481752a1..3a8446a8d 100644 --- a/internal/test/mock_interfaces.go +++ b/internal/test/mock_interfaces.go @@ -11,6 +11,7 @@ import ( btcec "github.com/btcsuite/btcd/btcec/v2" btcutil "github.com/btcsuite/btcd/btcutil" + psbt "github.com/btcsuite/btcd/btcutil/psbt" chainhash "github.com/btcsuite/btcd/chaincfg/chainhash" wire "github.com/btcsuite/btcd/wire" wtxmgr "github.com/btcsuite/btcwallet/wtxmgr" @@ -284,6 +285,39 @@ func (mr *MockWalletKitClientMockRecorder) EstimateFeeRate(ctx, confTarget inter return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EstimateFeeRate", reflect.TypeOf((*MockWalletKitClient)(nil).EstimateFeeRate), ctx, confTarget) } +// FinalizePsbt mocks base method. +func (m *MockWalletKitClient) FinalizePsbt(ctx context.Context, packet *psbt.Packet, account string) (*psbt.Packet, *wire.MsgTx, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "FinalizePsbt", ctx, packet, account) + ret0, _ := ret[0].(*psbt.Packet) + ret1, _ := ret[1].(*wire.MsgTx) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 +} + +// FinalizePsbt indicates an expected call of FinalizePsbt. +func (mr *MockWalletKitClientMockRecorder) FinalizePsbt(ctx, packet, account interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FinalizePsbt", reflect.TypeOf((*MockWalletKitClient)(nil).FinalizePsbt), ctx, packet, account) +} + +// FundPsbt mocks base method. +func (m *MockWalletKitClient) FundPsbt(ctx context.Context, req *walletrpc.FundPsbtRequest) (*psbt.Packet, int32, []*walletrpc.UtxoLease, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "FundPsbt", ctx, req) + ret0, _ := ret[0].(*psbt.Packet) + ret1, _ := ret[1].(int32) + ret2, _ := ret[2].([]*walletrpc.UtxoLease) + ret3, _ := ret[3].(error) + return ret0, ret1, ret2, ret3 +} + +// FundPsbt indicates an expected call of FundPsbt. +func (mr *MockWalletKitClientMockRecorder) FundPsbt(ctx, req interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FundPsbt", reflect.TypeOf((*MockWalletKitClient)(nil).FundPsbt), ctx, req) +} + // LeaseOutput mocks base method. func (m *MockWalletKitClient) LeaseOutput(ctx context.Context, lockID wtxmgr.LockID, op wire.OutPoint, leaseTime time.Duration) (time.Time, error) { m.ctrl.T.Helper() @@ -345,18 +379,18 @@ func (mr *MockWalletKitClientMockRecorder) ListUnspent(ctx, minConfs, maxConfs i } // NextAddr mocks base method. -func (m *MockWalletKitClient) NextAddr(ctx context.Context) (btcutil.Address, error) { +func (m *MockWalletKitClient) NextAddr(ctx context.Context, accountName string, addressType walletrpc.AddressType, change bool) (btcutil.Address, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "NextAddr", ctx) + ret := m.ctrl.Call(m, "NextAddr", ctx, accountName, addressType, change) ret0, _ := ret[0].(btcutil.Address) ret1, _ := ret[1].(error) return ret0, ret1 } // NextAddr indicates an expected call of NextAddr. -func (mr *MockWalletKitClientMockRecorder) NextAddr(ctx interface{}) *gomock.Call { +func (mr *MockWalletKitClientMockRecorder) NextAddr(ctx, accountName, addressType, change interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NextAddr", reflect.TypeOf((*MockWalletKitClient)(nil).NextAddr), ctx) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NextAddr", reflect.TypeOf((*MockWalletKitClient)(nil).NextAddr), ctx, accountName, addressType, change) } // PublishTransaction mocks base method. @@ -402,6 +436,21 @@ func (mr *MockWalletKitClientMockRecorder) SendOutputs(ctx, outputs, feeRate, la return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendOutputs", reflect.TypeOf((*MockWalletKitClient)(nil).SendOutputs), ctx, outputs, feeRate, label) } +// SignPsbt mocks base method. +func (m *MockWalletKitClient) SignPsbt(ctx context.Context, packet *psbt.Packet) (*psbt.Packet, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SignPsbt", ctx, packet) + ret0, _ := ret[0].(*psbt.Packet) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// SignPsbt indicates an expected call of SignPsbt. +func (mr *MockWalletKitClientMockRecorder) SignPsbt(ctx, packet interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SignPsbt", reflect.TypeOf((*MockWalletKitClient)(nil).SignPsbt), ctx, packet) +} + // MockChainNotifierClient is a mock of ChainNotifierClient interface. type MockChainNotifierClient struct { ctrl *gomock.Controller diff --git a/internal/test/walletkit_mock.go b/internal/test/walletkit_mock.go index 6ac4837d0..de0950bce 100644 --- a/internal/test/walletkit_mock.go +++ b/internal/test/walletkit_mock.go @@ -7,6 +7,7 @@ import ( "time" "github.com/btcsuite/btcd/btcutil" + "github.com/btcsuite/btcd/btcutil/psbt" "github.com/btcsuite/btcd/chaincfg" "github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/btcsuite/btcd/wire" @@ -85,7 +86,9 @@ func (m *MockWalletKit) DeriveKey(_ context.Context, in *keychain.KeyLocator) ( }, nil } -func (m *MockWalletKit) NextAddr(context.Context) (btcutil.Address, error) { +func (m *MockWalletKit) NextAddr(context.Context, string, + walletrpc.AddressType, bool) (btcutil.Address, error) { + addr, err := btcutil.NewAddressWitnessPubKeyHash( make([]byte, 20), &chaincfg.TestNet3Params, ) @@ -96,7 +99,7 @@ func (m *MockWalletKit) NextAddr(context.Context) (btcutil.Address, error) { } func (m *MockWalletKit) PublishTransaction(_ context.Context, - tx *wire.MsgTx, label string) error { + tx *wire.MsgTx, _ string) error { m.AddTx(tx) m.TxPublishChannel <- tx @@ -149,7 +152,7 @@ func (m *MockWalletKit) ListSweeps(_ context.Context) ([]string, error) { return m.Sweeps, nil } -// AddRelevantTx marks the given transaction as relevant. +// AddTx marks the given transaction as relevant. func (m *MockWalletKit) AddTx(tx *wire.MsgTx) { m.lock.Lock() m.Transactions = append(m.Transactions, tx.Copy()) @@ -170,3 +173,62 @@ func (m *MockWalletKit) ListAccounts(context.Context, string, return nil, nil } + +// FundPsbt creates a fully populated PSBT that contains enough inputs +// to fund the outputs specified in the template. There are two ways of +// specifying a template: Either by passing in a PSBT with at least one +// output declared or by passing in a raw TxTemplate message. If there +// are no inputs specified in the template, coin selection is performed +// automatically. If the template does contain any inputs, it is assumed +// that full coin selection happened externally and no additional inputs +// are added. If the specified inputs aren't enough to fund the outputs +// with the given fee rate, an error is returned. +// After either selecting or verifying the inputs, all input UTXOs are +// locked with an internal app ID. +// +// NOTE: If this method returns without an error, it is the caller's +// responsibility to either spend the locked UTXOs (by finalizing and +// then publishing the transaction) or to unlock/release the locked +// UTXOs in case of an error on the caller's side. +func (m *MockWalletKit) FundPsbt(_ context.Context, + _ *walletrpc.FundPsbtRequest) (*psbt.Packet, int32, + []*walletrpc.UtxoLease, error) { + + return nil, 0, nil, nil +} + +// SignPsbt expects a partial transaction with all inputs and outputs +// fully declared and tries to sign all unsigned inputs that have all +// required fields (UTXO information, BIP32 derivation information, +// witness or sig scripts) set. +// If no error is returned, the PSBT is ready to be given to the next +// signer or to be finalized if lnd was the last signer. +// +// NOTE: This RPC only signs inputs (and only those it can sign), it +// does not perform any other tasks (such as coin selection, UTXO +// locking or input/output/fee value validation, PSBT finalization). Any +// input that is incomplete will be skipped. +func (m *MockWalletKit) SignPsbt(_ context.Context, + _ *psbt.Packet) (*psbt.Packet, error) { + + return nil, nil +} + +// FinalizePsbt expects a partial transaction with all inputs and +// outputs fully declared and tries to sign all inputs that belong to +// the wallet. Lnd must be the last signer of the transaction. That +// means, if there are any unsigned non-witness inputs or inputs without +// UTXO information attached or inputs without witness data that do not +// belong to lnd's wallet, this method will fail. If no error is +// returned, the PSBT is ready to be extracted and the final TX within +// to be broadcast. +// +// NOTE: This method does NOT publish the transaction once finalized. It +// is the caller's responsibility to either publish the transaction on +// success or unlock/release any locked UTXOs in case of an error in +// this method. +func (m *MockWalletKit) FinalizePsbt(_ context.Context, _ *psbt.Packet, + _ string) (*psbt.Packet, *wire.MsgTx, error) { + + return nil, nil, nil +} diff --git a/poolrpc/format.go b/poolrpc/format.go new file mode 100644 index 000000000..80a15292d --- /dev/null +++ b/poolrpc/format.go @@ -0,0 +1,26 @@ +package poolrpc + +import ( + "fmt" + + "github.com/lightninglabs/protobuf-hex-display/jsonpb" + "github.com/lightninglabs/protobuf-hex-display/proto" +) + +var ( + jsonMarshaler = &jsonpb.Marshaler{ + EmitDefaults: true, + OrigName: true, + } +) + +// PrintMsg prints a protobuf message as JSON, suitable for logging (without any +// indentation). +func PrintMsg(message proto.Message) string { + jsonStr, err := jsonMarshaler.MarshalToString(message) + if err != nil { + return fmt.Sprintf("", err) + } + + return jsonStr +} diff --git a/rpcserver.go b/rpcserver.go index 9e29fa5af..c6cc2c173 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -15,7 +15,6 @@ import ( "github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/btcsuite/btcd/txscript" "github.com/btcsuite/btcd/wire" - "github.com/davecgh/go-spew/spew" "github.com/lightninglabs/lndclient" "github.com/lightninglabs/pool/account" "github.com/lightninglabs/pool/auctioneer" @@ -246,15 +245,16 @@ func (s *rpcServer) serverHandler(blockChan chan int32, blockErrChan chan error) continue } - rpcLog.Debugf("Received message from the server: %v", msg) + rpcLog.Debugf("Received message from the server: %s", + poolrpc.PrintMsg(msg)) err := s.handleServerMessage(msg) // Only shut down if this was a terminal error, and not // a batch reject (should rarely happen, but it's // possible). if err != nil && !errors.Is(err, order.ErrMismatchErr) { - rpcLog.Errorf("Error handling server message: %v", - err) + rpcLog.Errorf("Error handling server message: "+ + "%v", err) interceptor.RequestShutdown() } @@ -266,16 +266,16 @@ func (s *rpcServer) serverHandler(blockChan chan int32, blockErrChan chan error) rpcLog.Errorf("Error in server stream: %v", err) err := s.auctioneer.HandleServerShutdown(err) if err != nil { - rpcLog.Errorf("Error closing stream: %v", - err) + rpcLog.Errorf("Error closing stream: "+ + "%v", err) } } rpcLog.Error("Unknown server error: %v", err) case height := <-blockChan: - rpcLog.Infof("Received new block notification: height=%v", - height) + rpcLog.Infof("Received new block notification: "+ + "height=%v", height) s.updateHeight(height) case err := <-blockErrChan: @@ -307,8 +307,9 @@ func (s *rpcServer) handleServerMessage( // A new batch has been assembled with some of our orders. case *auctioneerrpc.ServerAuctionMessage_Prepare: // Parse and formally validate what we got from the server. - rpcLog.Tracef("Received prepare msg from server, batch_id=%x: %v", - msg.Prepare.BatchId, spew.Sdump(msg)) + rpcLog.Tracef("Received prepare msg from server, "+ + "batch_id=%x: %v", msg.Prepare.BatchId, + poolrpc.PrintMsg(msg.Prepare)) batch, err := order.ParseRPCBatch(msg.Prepare) if err != nil { // If we aren't able to parse the batch for some @@ -416,8 +417,9 @@ func (s *rpcServer) handleServerMessage( // The previously prepared batch has been executed and we can finalize // it by opening the channel and persisting the account and order diffs. case *auctioneerrpc.ServerAuctionMessage_Finalize: - rpcLog.Tracef("Received finalize msg from server, batch_id=%x: %v", - msg.Finalize.BatchId, spew.Sdump(msg)) + rpcLog.Tracef("Received finalize msg from server, "+ + "batch_id=%x: %v", msg.Finalize.BatchId, + poolrpc.PrintMsg(msg.Finalize)) rpcLog.Infof("Received FinalizeMsg for batch=%x", msg.Finalize.BatchId) @@ -470,7 +472,8 @@ func (s *rpcServer) handleServerMessage( ) default: - return fmt.Errorf("unknown server message: %v", msg) + return fmt.Errorf("unknown server message: %v", + poolrpc.PrintMsg(rpcMsg)) } return nil diff --git a/sidecar_acceptor.go b/sidecar_acceptor.go index df1c3115d..2664ed794 100644 --- a/sidecar_acceptor.go +++ b/sidecar_acceptor.go @@ -8,7 +8,6 @@ import ( "sync" "github.com/btcsuite/btcd/btcec/v2" - "github.com/davecgh/go-spew/spew" "github.com/lightninglabs/lndclient" "github.com/lightninglabs/pool/account" "github.com/lightninglabs/pool/auctioneer" @@ -16,6 +15,7 @@ import ( "github.com/lightninglabs/pool/clientdb" "github.com/lightninglabs/pool/funding" "github.com/lightninglabs/pool/order" + "github.com/lightninglabs/pool/poolrpc" "github.com/lightninglabs/pool/sidecar" "github.com/lightningnetwork/lnd/keychain" "github.com/lightningnetwork/lnd/subscribe" @@ -526,37 +526,40 @@ func (a *SidecarAcceptor) handleServerMessage( switch msg := serverMsg.Msg.(type) { case *auctioneerrpc.ServerAuctionMessage_Prepare: - sdcrLog.Tracef("Received prepare msg from server, "+ - "batch_id=%x: %v", msg.Prepare.BatchId, spew.Sdump(msg)) + "batch_id=%x: %v", msg.Prepare.BatchId, + poolrpc.PrintMsg(msg.Prepare)) if err := a.matchPrepare(msg.Prepare); err != nil { - sdcrLog.Errorf("unable to handle prepare message: %v", err) + sdcrLog.Errorf("unable to handle prepare message: %v", + err) return a.sendRejectBatch(msg.Prepare.BatchId, nil, err) } case *auctioneerrpc.ServerAuctionMessage_Sign: - sdcrLog.Tracef("Received sign msg from server, batch_id=%x: %v", - msg.Sign.BatchId, spew.Sdump(msg)) + msg.Sign.BatchId, poolrpc.PrintMsg(msg.Sign)) if err := a.matchSign(msg.Sign); err != nil { sdcrLog.Errorf("unable to handle sign message: %v", err) - return a.sendRejectBatch(a.pendingBatch.ID[:], a.pendingBatch, err) + return a.sendRejectBatch( + a.pendingBatch.ID[:], a.pendingBatch, err, + ) } case *auctioneerrpc.ServerAuctionMessage_Finalize: batchID := msg.Finalize.BatchId sdcrLog.Tracef("Received finalize msg from server, "+ - "batch_id=%x: %v", batchID, spew.Sdump(msg)) + "batch_id=%x: %v", batchID, + poolrpc.PrintMsg(msg.Finalize)) // This operation cannot fail. a.matchFinalize() default: sdcrLog.Debugf("Received msg %v from auctioneer on sidecar "+ - "client: %v", msg) + "client: %v", poolrpc.PrintMsg(serverMsg)) } return nil