Commit Graph
100 Commits
Author SHA1 Message Date
Johan T. Halseth e4301d3a8f lnwire: rename ErrorCode -> FundingError
To make it clear that these errors are not part of the spec, rename them
to FundingError.
2019-09-20 10:55:21 +02:00
Johan T. Halseth 33fe09482b lnwire+multi: define Error() for lnwire.Error
To make lnwire.Error actually satisfy the error interface, define the
Error method directly.
2019-09-20 10:55:21 +02:00
Johan T. Halseth 949f6c6cec lnwire: remove ErrorCode encoding/decoding
Never sent on the wire.
2019-09-20 10:55:20 +02:00
Johan T. Halseth ff37b711c6 funding: dont's send ErrorCode on wire
Since the ErrorCodes are not part of the spec, they cannot be read by
other implementations.

Instead of only sending the error code we therefore send the complete
error message. This will have the same effect at the client, as it will
just get the full error instead of the code indicating which error it
is. It will also be compatible with other impls.

Note that the GRPC error codes will change, since we don't set them
anymore.
2019-09-20 10:55:20 +02:00
Johan T. Halseth e4751f1361 Merge pull request #3517 from halseth/channel-point-log
lnwallet/channel: add missing chanpoint to log
2019-09-19 15:14:38 +02:00
Johan T. Halseth c308042ae0 lnwallet/channel: add missing chanpoint to log 2019-09-19 10:40:32 +02:00
Johan T. Halseth ce9f7faff2 contractcourt/channel_arbitrator: handle breach channel at startup
Earlier the channel arbitrator would fail to recognize channels pending
close that were in the breached state. This lead to the state machine
not progressing correctly, and in some cases crashing since we would
attempt to force close an already closed channel.

A test TestChannelArbitratorForceCloseBreachedChannel is added to
exercise one of these scenarios.
2019-09-18 13:05:35 +02:00
Johan T. Halseth 26b7ec1b94 contractcourt/channel_arbitrator: define and react to breachClose
Earlier we would not react to breaches, as these are handled by other
subsystems. Now we advances our state machine in case of breach, such
that we'll gracefully exit, and won't have leftover state in case of a
restart.

A simple test TestChannelArbitratorBreachClose to exercise this behavior
is added.
2019-09-18 13:05:35 +02:00
Johan T. Halseth 504a910def make: run linter on verbose 2019-09-18 09:07:53 +02:00
Johan T. Halseth 00d1890dd0 lint: skip files generated for mobile 2019-09-18 09:07:21 +02:00
Johan T. Halseth 1a4ba97562 Merge pull request #3274 from esneider/fix-typo-in-doc
Fix typo in doc
2019-09-18 08:37:06 +02:00
Johan T. Halseth 92123c603d gossiper: retransmit self NodeAnnouncement 2019-09-16 10:54:42 +02:00
Johan T. Halseth 24004fcb37 gossiper+server: define SelfNodeAnnouncement 2019-09-16 10:54:42 +02:00
Johan T. Halseth e36d15582c discovery/gossiper test: add TestRetransmit
This commit adds a test that ensures outdated announcements are
retransmitted when the RetransmitTicker ticks.
2019-09-16 10:54:38 +02:00
Johan T. Halseth 70d63abe9f discovery/test: set global test timestamp 2019-09-16 10:23:01 +02:00
Johan T. Halseth 8b9fd039ec discovery/gossiper test: remove mockGraphSource.SelfEdges 2019-09-16 10:23:01 +02:00
Johan T. Halseth e201fbe396 discovery+server: RetransmitDelay->RetransmitTicker
Also let retransmitStaleChannels take a timestamp, to make it easier to
test.
2019-09-16 10:23:01 +02:00
Johan T. Halseth 74c9551564 discovery+server: make RebroadcastInterval part of config 2019-09-16 10:23:00 +02:00
Johan T. Halseth 3d8f194670 discovery/gossiper: extract adding nodeAnnouncement into method 2019-09-16 10:23:00 +02:00
Johan T. Halseth d195acc632 chainntnfs/neutrino: start concurrent queues prior to connection
Similar to what was done for btcd, just to make sure we won't be blocked
on any incoming notifications, start the queues first thing during
startup.
2019-09-16 08:54:06 +02:00
Johan T. Halseth 6b6beb4d7d chainntnfs/btcd: start concurrent queues prior to connection
We would establish the connection to the chain backend and start getting
block notifications before we had started the concurrent queues, which
would lead to the OnBlockConnected call being blocked, and a deadlock
(since GetBestBlock would never return).

Instead we make sure to start the queues before establishing the
connection, consuming the notifications right away.
2019-09-16 08:54:06 +02:00
Johan T. Halseth 1dbb653b3a Merge pull request #3501 from alrs/fix-test-errors
Cross-Project Sweep to Fix Dropped Test Errors
2019-09-13 14:15:34 +02:00
Johan T. Halseth b82286e83b Merge pull request #3498 from alrs/fix-channeldb-errors
channeldb Error Handling Fixes
2019-09-12 21:20:10 +02:00
Johan T. Halseth 8f74ec2f1a Merge pull request #3491 from fiatjaf/patch-1
Fix error message for wrong size description_hash.
2019-09-12 21:08:02 +02:00
Johan T. Halseth 01f696afce Merge pull request #3487 from matheusd/lnd-fix-extra-dave
itest: Shutdown final Dave node in testChanRestore
2019-09-12 14:55:53 +02:00
Johan T. Halseth e61ec3a46d Merge pull request #3467 from hsjoberg/norest-config
config: Add norest config for disabling REST API
2019-09-12 08:20:37 +02:00
Johan T. Halseth 2dd23819bb Merge pull request #3486 from joostjager/remove-unused
multi: remove dead code
2019-09-11 08:52:50 +02:00
Johan T. Halseth 78e87d148f Merge pull request #3475 from chokoboko/fix-pilot-log-message
trivial: fix log message in initAutoPilot
2019-09-09 10:25:46 +02:00
Johan T. Halseth a8cb1c80eb mobile: add README 2019-09-05 09:22:54 +02:00
Johan T. Halseth fef2074c1d mobile: add sample_lnd.conf 2019-09-05 09:22:54 +02:00
Johan T. Halseth 3aa9f18395 make: define make android, make mobile (ios+android) 2019-09-05 09:22:54 +02:00
Johan T. Halseth 4dcaea1f5d make: define make ios, make vendor 2019-09-05 09:22:54 +02:00
Johan T. Halseth 8a92ccbbf4 mobile/bindings: add mobile bindings 2019-09-05 09:22:54 +02:00
Johan T. Halseth a5c63786c6 make+mobile: define gen_bindings.sh
gen_bindings uses falafel to generate Go bindings from the lnrpc
protos.
2019-09-05 09:22:54 +02:00
Johan T. Halseth fa21601d07 lnd+cmd/lnd/main: add ListenerCfg to Main
ListenerCfg allows passing custom listeners to the main method, to be
used for the wallet unlocker and rpc server. If these are set these will
be used instead of the regular RPC listeners.
2019-09-05 09:22:54 +02:00
Johan T. Halseth 2562fdbdda lnd+rpcserver: extract listener setup into closure 2019-09-05 09:22:54 +02:00
Johan T. Halseth 187bd29d2d gitignore: add mobile/build 2019-09-05 09:22:53 +02:00
Johan T. Halseth d7f0372fa2 lntest/itest: use timeout constants in rejectHTLC test
The local timeout could be too short for certain backends.
2019-09-02 12:05:51 +02:00
Johan T. Halseth 2f1aad257c autopilot/agent: trace log skipped nodes during scoring 2019-09-02 10:41:00 +02:00
Johan T. Halseth d5ab95546e autopilot/combinedattach: trace log scoring process from sub heuristics 2019-09-02 10:40:59 +02:00
Johan T. Halseth b2560b4ad2 autopilot/externalscoreattach: trace log scoring process 2019-09-02 10:40:59 +02:00
Johan T. Halseth bad9f4b685 autopilot/prefattach: trace log score process 2019-09-02 10:40:58 +02:00
Johan T. Halseth 2dbc4fe973 autopilot/agent: move expensive graph lookup after channel size check 2019-09-02 10:35:14 +02:00
Johan T. HalsethandWilmer Paulino c3480c6066 lntest/bitcoind: set debug loglevel
Co-authored-by: Wilmer Paulino <wilmer.paulino@gmail.com>
2019-09-02 09:37:41 +02:00
Johan T. Halseth 168fc4e1ab lntest/itest: cleanup force closed channel in testSendUpdateDisableChannel
Otherwise following tests would be flaky because of unexpected sweep transaction in the mempool.
2019-09-02 09:37:37 +02:00
Johan T. Halseth 857a2c3e65 make+travis: enable bitcoind itests on travis 2019-09-02 09:37:37 +02:00
Johan T. Halseth a57b3de7f9 lntest: compile time check btcd and neutrino BackendCfg interface 2019-09-02 09:37:37 +02:00
Johan T. Halseth 45d41dce17 lntest: add BitcoindBackendCfg 2019-09-02 09:37:33 +02:00
Johan T. Halseth 35f3544111 lnd_test: use RegTest instead of SimNet during integration tests 2019-09-02 09:37:23 +02:00
Johan T. Halseth 81cb3cb739 Merge pull request #3434 from wpaulino/multi-hop-htlc-local-timeout-mempool-flake
lntest/itest: resolve mempool flake in multi-hop htlc local timeout test
2019-09-02 09:35:03 +02:00
Johan T. Halseth 281c535b49 Merge pull request #3427 from cfromknecht/node-info-update-order
rpcserver: order updates in getnodeinfo by increasing pubkey
2019-08-29 09:13:48 +02:00
Johan T. Halseth 2026d3b45e Merge pull request #3432 from cfromknecht/bolt11-features
zpay32: BOLT 11 Feature Bits
2019-08-28 15:23:13 +02:00
Johan T. Halseth 9ef66f568f Merge pull request #2203 from ccdle12/reject-htlc-option
htlcswitch+config+server: adding RejectHTLC flag
2019-08-26 14:53:32 +02:00
Johan T. Halseth d2435a4dc3 Merge pull request #3059 from champo/rpc_drop
lnd: close the wallet unlock grpc server
2019-08-26 14:18:33 +02:00
Johan T. Halseth 21baa7bf18 multi: fix linter errors 2019-08-07 10:53:10 +02:00
Johan T. Halseth 3207c8a736 make: change linter gometalinter->golangci-lint 2019-08-07 10:53:09 +02:00
Johan T. Halseth 74f0c5f00f log: correct NTFR -> ntfrLog mapping
Most likely because of a typo, NTFR was mapping to ntfnLog instead of
ntfrLog.

Originally added in 59e2be5306
2019-08-05 15:21:59 +02:00
Johan T. Halseth 8793cf0a1e Merge pull request #3344 from Roasbeef/neutrino-sync-deadlock-fix
build: update to neutrino version w/ shutdown fix
2019-07-25 08:59:13 +02:00
Johan T. Halseth 5c4ac9f965 Merge pull request #3345 from Roasbeef/tower-fixes
watchtower: minor client side tower fixes
2019-07-25 08:58:33 +02:00
Johan T. Halseth 2bef62b467 lnd: remove global var access from genCertPair
Instead pass the optional strings as slices to the method.
2019-07-22 09:26:25 +02:00
Johan T. Halseth 7838e6e1fa autopilot/agent_test: add more agent channel allocation testcases
Add tests for allocation when well within and well above channel budget.
2019-07-18 00:58:12 +02:00
Johan T. Halseth 68f7642564 autopilot/agent_test: wait for expected num chans and balance
Previously we waited only for the number of channels to become what we
expected, but this wasn't enough. Sometimes the agent had't yet updated
its internal balance, causing the test to fail with an unexpected
balance.
2019-07-18 00:58:12 +02:00
Johan T. Halseth bf7f392c11 autopilot: use subtractFees when funding channel
To make the autopilot able to account for fees, we let it use the
subtractFees option when opening channels.

This makes sure that each channel we attempt to open will eat at most
Amt out of our budget. Previously fees would eat into our funds in
addition, causing us to deplete our funds more than expected on each
channel opening.
2019-07-18 00:58:12 +02:00
Johan T. Halseth 0405703019 fundingmanager test: add TestFundingManagerFundAll
TestFundingManagerFundAll tests that we can initiate a funding request to
use the funds remaining in the wallet. This should produce a funding tx with
no change output.
2019-07-18 00:58:12 +02:00
Johan T. Halseth b9816259cb fundingmanager+server: define subtractFees
Let one initiate a funding request with the remaining funds in the
wallet.
2019-07-18 00:58:12 +02:00
Johan T. Halseth 87c8165f01 mock: make it possible to set list of returned utxos 2019-07-18 00:58:12 +02:00
Johan T. Halseth 2cd7d5a2a4 fundingmanager test: extract publishing logic into fundChannel, set funding fee during unit tests 2019-07-18 00:58:12 +02:00
Johan T. Halseth f15d81426c lnwallet/wallet: define SubtractFees for InitFundingReserveMsg
This commit adds a SubtractFees option to the funding request, letting
the caller specify that the fees should be deducted from the funding
amount. This paves the way for letting the funding manager spend up to a
given amount when creating a channel, like the rest of the funds in the
wallet.
2019-07-18 00:33:15 +02:00
Johan T. Halseth 4239f7d600 lnwallet/wallet: add coinSelectSubtractFees 2019-07-18 00:33:15 +02:00
Johan T. Halseth 1b2297c2b5 lnwallet/wallet: extract contribution setup into initOurContribution
This lets us easily call unlock() in case contribution setup fails.
2019-07-18 00:33:15 +02:00
Johan T. Halseth 44384a1b5b lnwallet: move coin selection before ChannelReservation
Now that coin selection is independent of creating the channel
reservation, we can move it first, in preparation for doing custom coin
selection.
2019-07-18 00:33:14 +02:00
Johan T. Halseth 98a3d04ba3 lnwallet: make selectCoinsAndChange return selected coins
This makes the method independent of the ChannelContribution struct.

We also add a function closure to the return of selectCoinsAndChange,
that let is unlock the selected output in case of error.
2019-07-18 00:33:14 +02:00
Johan T. Halseth fcf74debe6 lnwallet+funding: rename Capacity and FundingAmt
Instead use LocalFundingAmt and RemoteFundingAmt to make it clear who is
contributing funds.
2019-07-18 00:33:14 +02:00
Johan T. Halseth e716251805 server+funding: remove unused remoteFundingAmt 2019-07-18 00:33:14 +02:00
Johan T. Halseth 2f5c1a69fb lnwallet test: add TestCoinSelect 2019-07-18 00:33:14 +02:00
Johan T. Halseth 78da62c6f7 fundingmanager tests: run tests in parallel 2019-07-18 00:33:14 +02:00
Johan T. Halseth 452ee6aad4 fundingmanager+server: define MaxPendingChans. RejectPush in funding config
This commit makes the funding manager access the MaxPendingChannels and
RejectPush values from the fundingConfig instead of the global config
struct.

Done to avoid sharing state between tests.
2019-07-18 00:33:14 +02:00
Johan T. Halseth f069276970 Merge pull request #3306 from ottosuess/patch-4
invoicesrpc: fix route hint off-by-one-error
2019-07-12 12:28:15 +02:00
Johan T. Halseth e593c5e16f Merge pull request #3284 from wpaulino/bitcoind-zmq-unnecessary-timeouts
build: update dependencies to prevent unnecessary bitcoind ZMQ timeouts
2019-07-12 12:26:55 +02:00
Johan T. Halseth 0820b07c19 make: add -goroutinedump, rm pprof*.log to itest 2019-07-11 14:47:02 +02:00
Johan T. Halseth 8b64b14627 gitignore: add pprof files to gitignore 2019-07-11 14:44:50 +02:00
Johan T. Halseth 195a868455 lntest: add flag -goroutinedump 2019-07-11 14:44:44 +02:00
Johan T. Halsethandtaketa 8d5430dae3 lnd_test: add lndHarness to harnessTest, dump goroutines on Fatalf
Co-authored-by: taketa <853211b@gmail.com>
2019-07-11 14:41:41 +02:00
Johan T. Halsethandtaketa 314ba7db03 lntest/harness: add method SaveProfilesPages
SaveProfilesPages will write the active goroutines to files
pprof-n-*.log.

Co-authored-by: taketa <853211b@gmail.com>
2019-07-11 14:41:40 +02:00
Johan T. Halseth 6028722d71 lntest/node: make ProfilePort part of node config 2019-07-11 14:36:59 +02:00
Johan T. Halseth 7a5247b766 Merge pull request #3245 from breez/non_static_permissions
rpc: fix calculating RPC permissions.
2019-07-10 13:33:54 +02:00
Johan T. Halseth f0cbe46324 lnrpc: make BumpFee doc start with RPC name 2019-07-10 12:56:54 +02:00
Johan T. Halseth 25375d603c Merge pull request #3246 from tyzbit/fwdinghistory_3240
rpcserver: ForwardingHistory end_time defaults to time.Now()
2019-07-10 09:56:00 +02:00
Johan T. Halseth e775eddaee Merge pull request #3285 from cfromknecht/codeowners-typo
CODEOWNERS: fix aezeed typo
2019-07-10 09:53:46 +02:00
Johan T. Halseth b162595929 Merge pull request #3229 from halseth/fallback-hostname
lnd: fallback to localhost if failing getting hostname
2019-07-08 14:57:36 +02:00
Johan T. Halseth 601773958d lnd: fallback to localhost if failing getting hostname
Needed on some versions of Android.
2019-07-08 14:00:25 +02:00
Johan T. Halseth 8b83f03308 rpcserver+router: log terminal sendPayment error 2019-07-01 16:22:57 -07:00
Johan T. Halseth 7c4c64fffc lnrpc/rpc.proto: remove trailing spaces 2019-06-20 14:35:39 +02:00
Johan T. Halseth 97dda4f8c8 channeldb/migrations: skip migration for empty outgoing payments bucket
Previously the migration would fail if the source node was not set in
the database. Since we know that the source node must have been set
before making any payments, we check whether there actually are any
payments to migrate, and return early if not.
2019-06-18 21:14:16 +02:00
Johan T. Halseth 7df7449c47 Merge pull request #3187 from yaslama/UnknownAsDefaultAddressType
Use UnknownAddressType value as default in lnwallet.AddressType
2019-06-17 12:18:55 +02:00
Johan T. Halseth f98f452528 channeldb: avoid modifying bucket during cursor traversal
This is not safe according to bbolt documentation.
2019-06-14 21:09:03 +02:00
Johan T. Halseth ed8d635cf1 contractcourt/briefcase: avoid bucket modification in ForEach loop
Since the contents were deleted before the bucket was deleted, we just
delete the bucket immediately.
2019-06-14 21:09:02 +02:00
Johan T. Halseth b7a37728c0 channeldb/migrations: avoid modifying bucket during ForEach loop
bbolt documenation state that this is not safe and leads to undefined
behavior.
2019-06-14 21:09:02 +02:00
Johan T. Halseth f63c5d0170 Merge pull request #3182 from yaslama/addressTypeInitialization
Initialize addressType to UnknownAddressType
2019-06-14 10:32:01 +02:00
Johan T. Halseth dcaed7254e make: delete log files at new output file location 2019-06-12 16:44:21 +02:00