Commit Graph
100 Commits
Author SHA1 Message Date
Olaoluwa Osuntokun c19c872cff lnd: update invoiceRegistry to match new switch requirements 2018-06-29 16:03:51 -07:00
Olaoluwa Osuntokun 2196d9375e htlcswitch: obtain the min final CLTV delta directly from the InvoiceDatabase
In this commit, we modify the existing logic that would attempt to read
the min CLTV information from the invoice directly. With this route, we
avoid any sort of DB index modifications, as this information is already
stored within the payment request, which is already available to the
outside callers. By modifying the InvoiceDatabase interface, we avoid
having to make the switch aware of what the "primary" chain is.
2018-06-29 16:03:13 -07:00
Olaoluwa Osuntokun c914de177b Revert "rpc: include the FinalCltvDelta when writing new invoices to disk"
This reverts commit 4e264ee88e.
2018-06-29 12:40:53 -07:00
Olaoluwa Osuntokun e5f802c33c Revert "channeldb: explicitly store the FinalCltvDelta within the ContractTerm struct"
This reverts commit 8dcfeeaef5.
2018-06-29 12:40:42 -07:00
Olaoluwa Osuntokun 076fc71261 lnd: only print shutdown message if logs are initialized
In this commit, we fix a slight bug recently introduced by the addition
of the new signal package. As we now use a regular defer for many
actions, it may be possible that the logs aren't yet initialized (for
example, lnd -h), which can cause a panic if the shutdown procedure goes
to log before the logs have been initialized.
2018-06-29 12:18:19 -07:00
Olaoluwa Osuntokun c045defd0f Merge pull request #1358 from joostjager/newfee
routing: routing may come up with suboptimal routes (weight function)
2018-06-28 19:18:13 -07:00
Olaoluwa Osuntokun ff771968b6 Merge pull request #1392 from cfromknecht/signal-package
Signal/Interrupt package
2018-06-28 19:08:51 -07:00
Olaoluwa Osuntokun 64a07341f6 Merge pull request #1382 from joostjager/newroute-bug
routing: fix route fee calculation and channel capacity check
2018-06-28 19:01:33 -07:00
Olaoluwa Osuntokun 3a47c41c6b Merge pull request #1448 from Roasbeef/check-invoice-min-final
channeldb+htlcswitch: use the final min cltv delta in the invoice when link at exit hop
2018-06-28 18:39:33 -07:00
Olaoluwa Osuntokun 8ab464b4d1 Merge pull request #1456 from wpaulino/tor-post-lncfg
lncfg+config: parse and resolve onion addresses
2018-06-28 11:23:16 -07:00
Olaoluwa Osuntokun 17399994e4 config+server: update usage of lncfg methods to pass in resolver
In this commit, we update all the lncfg methods used to properly pass in
a new resolver. This is required in order to ensure that we don't leak
our DNS queries if Tor mode is active.
2018-06-27 18:10:34 -07:00
Olaoluwa Osuntokun 37f56ce976 lncfg: add tor addresses to test cases 2018-06-27 18:10:32 -07:00
Olaoluwa Osuntokun 197b920cac lncfg: update test cases to map port -> localhost:port 2018-06-27 18:10:31 -07:00
Olaoluwa Osuntokun f5f68858de lncfg: update verifyPort to map a plain port to localhost:port 2018-06-27 18:10:30 -07:00
Olaoluwa Osuntokun 5d66635aee lncfg: update ParseAddressString to be able to parse tor addrs 2018-06-27 18:10:29 -07:00
Olaoluwa Osuntokun c03f731643 server: properly use the set of normalized external ips 2018-06-27 16:43:38 -07:00
Olaoluwa Osuntokun c344a3a642 Merge pull request #1453 from cfromknecht/decayed-log-flake
htlcswitch/decayedlog_test: fix bug in gc unit test
2018-06-27 16:37:08 -07:00
Olaoluwa Osuntokun 4e264ee88e rpc: include the FinalCltvDelta when writing new invoices to disk 2018-06-26 19:50:05 -07:00
Olaoluwa Osuntokun a2f0d6d38e htlcswitch: use the delta within the time lock, not the default policy at exit node
In this commit, we fix a lingering bug within the link when we're the
exit node for a particular payment. Before this commit, we would assert
that the invoice gives us enough of a delta based on our current routing
policy. However, if the invoice was generated with a lower delta, or
we've changed from the default routing policy, then this would case us
to fail back any payments sent to us.

We fix this by instead using the newly available final CLTV delta
information within the extracted invoice.

Fixes #1431.
2018-06-26 19:50:04 -07:00
Olaoluwa Osuntokun 8dcfeeaef5 channeldb: explicitly store the FinalCltvDelta within the ContractTerm struct
In this commit, we move to explicitly storing a bit more information
within the invoice. Currently this information is already stored in the
payment request, but by storing it at this level, callers that may not
be in the state to fully decode a payment request can obtain this data.

We avoid a database migration by appending this data to the end of an
invoice. When decoding, we'll try to read out this extra information,
and simply return what we have if it isn't found.
2018-06-26 19:49:49 -07:00
Olaoluwa Osuntokun ec7cfc6906 Merge pull request #1447 from Roasbeef/forwarding-timelock-fix
routing+htlcswitch: finalize switch of CLTV delta directionality in path finding and link forwarding
2018-06-26 19:47:46 -07:00
Olaoluwa Osuntokun 81e647a520 Merge pull request #1449 from cfromknecht/wait-for-link-shutdown
Wait for link shutdown
2018-06-26 19:46:28 -07:00
Olaoluwa Osuntokun 05d1d4e845 Merge pull request #1262 from guggero/unix-sockets
rpc: add support for unix sockets
2018-06-26 18:17:27 -07:00
Olaoluwa Osuntokun b44ce7b366 Merge pull request #1312 from halseth/breacharbiter-wait-for-spend
breacharbiter: wait on spend events instead of timeout
2018-06-26 17:50:47 -07:00
Olaoluwa Osuntokun 6a6c29cd00 routing: fix incorrect expiry values in spec_example.json
In this commit, we fix the incorrect expiry values in the
spec_example.json test file. Many of the time locks were incorrect which
allowed bugs within the path finding logic related to CLTV deltas to go
un-detected.
2018-06-26 17:29:42 -07:00
Olaoluwa Osuntokun 6c986864ff routing: fix bug in newRoute, use time lock delta of prior hop, not current
In this commit, we fix an existing bug in the newRoute method. Before
this commit we would use the time lock delta of the current hop to
compute the outgoing time lock for the current hop. This is incorrect as
the time lock delta of the _outgoing_ hop should be used, as this is
what we're paying for "transit" on. This is a bug left over from when we
switched the meaning of the CLTV delta on the ChannelUpdate message
sometime last year.

The fix is simple: use the CLTV delta of the prior (later in the route)
hop.
2018-06-26 17:29:42 -07:00
Olaoluwa Osuntokun bdecc5bea9 htlcswitch: update forwarding policy verification to use new time lock info 2018-06-26 17:29:42 -07:00
Olaoluwa Osuntokun 7b4c150983 htlcswitch: add new incoming+outgoing timeout fields to htlcPacket 2018-06-26 17:29:41 -07:00
Olaoluwa Osuntokun 2bb5931bb7 htlcswitch: move timelock policy verification logic to HtlcSatifiesPolicy
In this commit, we extract the time lock policy verification logic from
the processRemoteAdds method to the HtlcSatifiesPolicy method. With this
change, we fix a lingering bug within the link: we'll no longer verify
time lock polices within the incoming link, instead we'll verify it at
forwarding time like we should. This is a bug left over from the switch
of what the CLTV delta denotes in the channel update message we made
within the spec sometime last year.
2018-06-26 17:29:41 -07:00
Olaoluwa Osuntokun 74ec9147b1 htlcswitch: extend the HtlcSatifiesPolicy to also accept timelock/height info
In this commit, we extend the existing HtlcSatifiesPolicy method to also
accept timelock and height information. This is required as an upcoming
commit will fix an existing bug in the forwarding logic wherein we use
the time lock policies of the incoming node rather than that of the
outgoing node.
2018-06-26 17:29:40 -07:00
Olaoluwa Osuntokun 6e051a80ff htlcswitch: fix bug in generateHops, use CLTV delta of prior hop to compute payload
In this commit, we fix a bug in the generateHops helper function. Before
this commit, it erroneously used the CLTV delta of the current hop,
rather than that of the prior hop when computing the payload. This was
incorrect, as when computing the timelock for the incoming hop, we need
to factor in the CTLV delta of the outgoing lock, not the incoming lock.
2018-06-26 17:29:40 -07:00
Olaoluwa Osuntokun 4eb07e8288 htlcswitch: add new TestForwardingAsymmetricTimeLockPolicies test
In this commit, we add a new test to the switch:
TestForwardingAsymmetricTimeLockPolicies. This test ensures that a link
has two channels, one of which has a greater CLTV delta than the latter,
that a payment will successfully be routed across the channels. Atm, the
test fails (including the fix to hop payload generation included in the
next commit).

Atm, due to the way that we check forwarding policies, we'll reject this
payment as we're attempting to enforce the policy of the incoming link
(cltv delta of 7), instead of that of the outgoing link (cltv delta of
6). As a result, atm, the incoming link checks if (incoming_timeout -
delta < outgoing_timeout). For the values in the test case: 112 - 7 <
106 -> 105 < 106, this check fails. The payload is proper, but the check
itself should be applied at the outgoing hop.
2018-06-26 17:29:39 -07:00
Olaoluwa Osuntokun b8fecfca71 Merge pull request #1442 from Roasbeef/async-link-stop
htlcswitch: in removeLink use new goroutine to stop existing link
2018-06-26 04:14:57 +02:00
Olaoluwa Osuntokun 1219e14955 Merge pull request #1399 from Roasbeef/zlib-decoding
lnwire: implement cautious zlib decoding for channel range queries
2018-06-26 04:13:54 +02:00
Olaoluwa Osuntokun 8ddb2bdc57 Merge pull request #1443 from brndnmtthws/add-profile-docs
docs: Add starter doc on debugging lnd.
2018-06-26 04:13:26 +02:00
Olaoluwa Osuntokun 23b1678266 lnwire: ensure zlib short chan id's are sorted 2018-06-25 16:16:37 -07:00
Olaoluwa Osuntokun 940b95aad7 lnwire: update testing.Quick tests to alternate between encoding types 2018-06-25 16:16:36 -07:00
Olaoluwa Osuntokun 5caf3d7310 lnwire: add new package level mutex to limit # of concurrent zlib decodings
In this commit, we add a new package level mutex. Each time we decode a
new set of chan IDs w/ zlib, we also grab this mutex. The purpose here
is to ensure that we only EVER allocate the maxZlibBufSize globally
across all peers. Otherwise, it may be possible for us to allocate up to
64 MB for _each_ peer, exposing an easy OOM attack vector.
2018-06-25 16:16:36 -07:00
Olaoluwa Osuntokun a0e2f8dbd1 lnwire: implement zlib encode/decode for channel range queries
In this commit, we implement zlib encoding and decoding for the channel
range queries. Notably, we utilize an io.LimitedReader to ensure that we
can enforce a hard cap on the total number of bytes we'll ever allocate
in a decoding attempt.
2018-06-25 16:16:13 -07:00
Olaoluwa Osuntokun 19a0eab804 htlcswitch: in removeLink use new goroutine to stop existing link
In this commit, we modify the removeLink method to be more asynchronous.
Before this commit, we would attempt to block until the peer exits.
However, it may be the case that at times time, then target link is
attempting to forward a batch of packets to the switch (forwardBatch).
Atm, this method doesn't pass in an external context/quit, so we can't
cancel this message/request. As a result, we'll now ensure that
`removeLink` doesn't block, so we can resume the switch's main loop as
soon as possible.
2018-06-25 16:04:24 -07:00
Olaoluwa Osuntokun c1c4b84757 Merge pull request #1372 from wpaulino/peer-log-unknown-channel
peer: prevent processing close msg if channel is not found
2018-06-26 00:54:58 +02:00
Olaoluwa Osuntokun 18f17ad49b Merge pull request #1419 from cfromknecht/update-channel-packager-sid
Update channel packager sid
2018-06-21 13:49:00 +01:00
Olaoluwa Osuntokun ce164a5233 Merge pull request #1418 from halseth/channel-stop
[bugfix] Channel stop bugfixes
2018-06-21 13:45:00 +01:00
Olaoluwa Osuntokun 70217422b5 Merge pull request #1417 from halseth/chanarb-stop
Properly stop ChannelArbitrators/blockEpocs
2018-06-21 13:42:20 +01:00
Olaoluwa Osuntokun fc658dbf60 docs: further clarify --txindex usage for full nodes 2018-06-18 14:01:25 +01:00
Olaoluwa Osuntokun 7c2307984d Merge pull request #1380 from cfromknecht/nursery-rebroadcast
utxonursery: rebroadcast finalized kinder txns on startup
2018-06-15 16:49:58 -07:00
Olaoluwa Osuntokun 2f6ff2666c Merge pull request #1296 from parakeety/add-tdt
htlcswitch: add basic table driven tests for ExpectedFee
2018-06-15 16:36:40 -07:00
Olaoluwa Osuntokun aeca4d6def Merge pull request #1390 from Roasbeef/sorted-closed-channels
rpc: sort closed channels in order of ascending height
2018-06-15 16:02:30 -07:00
Olaoluwa Osuntokun d82ef41245 rpc: sort closed channels in order of ascending height 2018-06-14 17:14:39 -07:00
Olaoluwa Osuntokun b5a228808b Merge pull request #1375 from wpaulino/gossiper-cancel-block-epochs
discovery/gossiper: hold ref to block epoch stream and cancel when stopped
2018-06-13 22:16:52 -07:00
Olaoluwa Osuntokun 6830024faf Merge pull request #1367 from halseth/waitpredicate-interval
lntest/harness: add pollIntervall to WaitPredicate
2018-06-13 19:17:30 -07:00
Olaoluwa Osuntokun 1e8a5104ba Merge pull request #1338 from Roasbeef/packet-queue-exit
htlcswitch: ensure the packet queue exits on stop
2018-06-13 19:17:12 -07:00
Olaoluwa Osuntokun 39f2739d84 Merge pull request #1229 from wpaulino/randomize-link-fee-updates
htlcswitch: randomize link fee updates
2018-06-13 19:11:48 -07:00
Olaoluwa Osuntokun 4a0d7b0244 Merge pull request #1374 from wpaulino/zero-amount-invoice-error
rpcserver: return err when paying 0 amt invoice and amt is not specified
2018-06-13 18:56:04 -07:00
Olaoluwa Osuntokun c1a1b3ba3d Merge pull request #1274 from joostjager/closechannels-squashed
rpc+lnrpc: add new closechannels cli+rpc command
2018-06-13 17:35:35 -07:00
Olaoluwa Osuntokun dddbfa7efe Merge pull request #1205 from wpaulino/initial-peer-bootstrap
server: improve initial peer bootstrapping
2018-06-13 16:51:41 -07:00
Olaoluwa Osuntokun f2273d9503 discovery: log failed attempts in replyShortChanIDs 2018-06-13 16:44:59 -07:00
Olaoluwa Osuntokun 0d607f675f Merge pull request #1344 from halseth/lndtest-defer-shutdown
integration tests: shut down nodes using defer
2018-06-13 15:57:17 -07:00
Olaoluwa Osuntokun 26636ce994 Merge pull request #1113 from wpaulino/fee-cutoff
rpc+routing: add support for fee limits when finding routes for payments
2018-06-12 19:34:23 -07:00
Olaoluwa Osuntokun f7156aa1d6 Merge pull request #1109 from wpaulino/nat-traversal
server: add support for NAT traversal and watching dynamic IP changes
2018-06-12 19:13:43 -07:00
Olaoluwa Osuntokun 80b531db62 Merge pull request #1303 from vegardengen/fix-docs-push-amount
Add clarification for push_amt argument to openchannel
2018-06-12 17:27:19 -07:00
Olaoluwa Osuntokun c3191a7728 Merge pull request #1349 from Roasbeef/server-fixes-itest-stability
test+server: finalize inbound/outbound fixes, update itests to account for fixes
2018-06-12 12:32:55 -07:00
Olaoluwa Osuntokun e60d2b774a htlcswitch: in event of duplicate link add, prefer newer link 2018-06-12 00:44:30 -07:00
Olaoluwa Osuntokun e1d8c37708 peer: only add an active link to the channelManager if addPeer succeeds
In this commit we fix an existing bug which could cause internal state
inconsistency between then switch, funding manager, and the peer. Before
this commit, we would _always_ add a new channel to the channelManager.
However, due to recent logic, it may be the case that this isn't the
channel that will ultimately reside in the link. As a result, we would
be unable to process incoming FundingLocked messages properly, as we
would mutate the incorrect channel in memory.

We remedy this by moving the inserting of the new channel into the
activeChannels map until the end of the loadActiveChannels method, where
we know that this will be the link that persists.
2018-06-12 00:44:26 -07:00
Olaoluwa Osuntokun 3db06cf7d5 htlcswitch: in removeLink properly remove items from the interfaceIndex
In this commit, we fix a bug in the way we handle removing items from
the interfaceIndex. Before this commit, we would delete all items items
with the target public key that of the peer that owns the link being
removed. However, this is incorrect as the peer may have other links
sill active.

In this commit, we fix this by first only deleting the link from the
peer's index, and then checking to see if the index is empty after this
deletion. Only if so do we delete the index for the peer all together.
2018-06-11 23:06:22 -07:00
Olaoluwa Osuntokun 03810603ee htlcswitch: modify interfaceIndex to no longer key 2nd lvl by ChannelLink
In this commit, we modify the interfaceIndex to no longer key the second
level of the index by the ChannelLink. Instead, we'll use the chan ID as
it's a stable identifier, unlike a reference to an interface.
2018-06-11 23:02:16 -07:00
Olaoluwa Osuntokun 1a15924d65 discovery: fix log for adding new gossip syncers
In this commit, we fix the logging when adding new gossip syncers. The
old log would log the byte array, rather than the byte slice. We fix
this by slicing before logging.
2018-06-11 22:58:30 -07:00
Olaoluwa Osuntokun 418ecbaa15 test: fix flake by allowing channel to load before close 2018-06-10 23:02:23 -07:00
Olaoluwa Osuntokun 15da55effb server: finish correction of inbound/outbound within the server
In this commit, we finish the fix for the inbound/outbound peer bool in
the server. The prior commit forgot to also flip the inbound/output maps
in Inbound/Outbound peer connected. As a result, the checks were
incorrect and could cause lnd to refuse to accept any more inbound
connections in the case of a concurrent connection attempt.
2018-06-10 23:02:22 -07:00
Olaoluwa Osuntokun 8885c3de8d server: defer cancelling the outbound connection until the tie-breaker 2018-06-10 23:02:22 -07:00
Olaoluwa Osuntokun 179b25c580 test: update switch persistence tests to account for bug fix in reconnection logic
With the recent bug fixes in the peer connection, it's no longer the
case that just disconnecting a certain peer causes it to no longer
connect to the other. As a result, we now shutdown Alice to ensure no
reconnection occurs. We'll then later restart alice when we restart
dave.
2018-06-10 23:02:22 -07:00
Olaoluwa Osuntokun 7f16e99a80 lntest: add new StopNode method 2018-06-10 23:02:21 -07:00
Olaoluwa Osuntokun c975753f1e server: remove pending conn request if we recv a outbound conn after a scheduled callback
In this commit, we ensure that if we're already ignoring a connection,
then we also ignore the pending persistent connection request.
Otherwise, we'll move to accept the replaced connection, but then
continue to attempt connection requests.
2018-06-10 23:02:15 -07:00
Olaoluwa Osuntokun dcf841c33b server: look up latest addr for node in peerTerminationWatcher
In this commit, we modify the look up for inbound peers to ensure that
we connect to the "freshest" address until we need to execute the
peerTerminationWatcher. We do this as it's possible for a channel to be
created by the remote peer during our session. If we don't query for the
node's address at the latest point, then we'll miss this new node
announcement for the node.
2018-06-10 23:02:10 -07:00
Olaoluwa Osuntokun 2e838abb3f Merge pull request #1350 from cfromknecht/switch-duplicate-links
Switch duplicate links
2018-06-10 18:13:26 -07:00
Olaoluwa Osuntokun 9c0c9baee0 Merge pull request #1345 from cfromknecht/gossip-direct-send-msg
discovery: bypass server for direct message sends
2018-06-10 16:38:23 -07:00
Olaoluwa Osuntokun b2e24f876b htlcswitch: ensure the packet queue exits on stop
In this commit, we ensure that the packet queue will always exit, by
continually signalling the main goroutine until it atomically sets a
bool that indicates its has been fully shutdown. It has been observed
that at times the main goroutine will wake up (due to the signal), but
then bypass the select and actually miss the quit signal, as a result
another signal is required. We'll continue to signals in a lazy loop
until the goroutine has fully exited.
2018-06-08 13:51:37 -07:00
Olaoluwa Osuntokun 15f812b10f lnwire: don't attempt to decode an empty/nil signature 2018-06-08 13:25:56 -07:00
Olaoluwa Osuntokun 4bde4c1c26 Merge pull request #1333 from Roasbeef/min-fee-rate
funding+htlcswitch: enforce min fee rate of 253 sat/kw on commitments
2018-06-06 21:00:13 -07:00
Olaoluwa Osuntokun 0177309dcf cmd/lncli: modify sendtoroute cmd to make reading routes from stdin optional
In this commit we modify the existing sendtoroutes command such that
users can either specify the route over stdin (using the special '-'
flag), via the keyword argument, or via the positional argument.
2018-06-06 20:45:57 -07:00
Olaoluwa Osuntokun bc9eca32ab rpc: refactor logic for SendPayment+SendToRoute
In this commit, we modify the logic for the two primary payment related
RPCs to reduce duplication, indentation, and consolidate logic. As a
result, we'll now accept rpcPaymentIntents, turn those into regular
paymentIntents (convert from proto) before finally dispatching via
unified function.
2018-06-06 20:45:56 -07:00
Olaoluwa Osuntokun eb65b0cd5a routing: check to see if pubkey is nil before logging in sendPayment
In this commit, we now need to check to see if the pubkey is nil as if
the user specified a set of manual routes, then the dest pubkey would be
empty.
2018-06-06 20:45:56 -07:00
Olaoluwa Osuntokun 0113035f6d routing: add new NewPaymentSessionFromRoutes function instead of interface
In this commit, we modify the recent refactoring of the mission control
sub-system to overload the existing payment session, rather than create
a brand new one. This allows us to re-use more of the existing logic, and
also feedback into mission control the failures incurred by any user
selected routes.
2018-06-06 20:45:56 -07:00
Olaoluwa Osuntokun 9f183dc08f lnrpc: switch REST endpoint for SendToRoute to /v1/channels/transactions/route 2018-06-06 20:45:53 -07:00
Olaoluwa Osuntokun e3d1fb0d4b Merge pull request #1339 from cfromknecht/switch-htlc-satisfies-deadlock
htlcswitch/link: remove deadlock in htlc validation
2018-06-06 18:31:10 -07:00
Olaoluwa Osuntokun 849ee5e0dc Merge pull request #1008 from wpaulino/peer-connection-logic
server: fix inbound/outbound peer connection logic
2018-06-06 18:07:18 -07:00
Olaoluwa Osuntokun 2b2b83f97c Merge pull request #1335 from halseth/peer-mutex-relaxation
Peer mutex relaxation
2018-06-06 16:29:53 -07:00
Olaoluwa Osuntokun 782fd9d709 Merge pull request #1327 from cfromknecht/waiting-proof-store-external-consistency
channeldb/waitingproof: improve external consistency of store
2018-06-06 15:50:37 -07:00
Olaoluwa Osuntokun 991c9fb7dd Merge pull request #1332 from Roasbeef/delete-update-index-items
channeldb: ensure items from the update index are actually deleted
2018-06-05 19:34:33 -07:00
Olaoluwa Osuntokun 1d994439e2 Merge pull request #1323 from Roasbeef/accept-duplicate-waiting-proofs
channeldb: don't reject duplicate waiting proofs
2018-06-05 19:20:29 -07:00
Olaoluwa Osuntokun 8f68d0e605 funding+htlcswitch: enforce min fee rate of 253 sat/kw on commitments
In this commit, we add and enforce a min fee rate for commitment
transactions created, and also any updates we propose to the remote
party. It's important to note that this is only a temporary patch, as
nodes can dynamically raise their min fee rate whenever their mempool is
saturated.

Fixes #1330.
2018-06-05 17:50:50 -07:00
Olaoluwa Osuntokun f9c220cc7b config: fix bug w/ tor onion services, only disable listen if no v2 or v3 2018-06-05 17:40:48 -07:00
Olaoluwa Osuntokun dd4cab054d channeldb: ensure items from the update index are actually deleted
In this commit, we fix an existing bug in the new graph query sync
feature. Before this commit, when a block is pruned, we would never
actually delete the update index entries. This is due to the fact that
we would attempt to delete the entries from the update index _after_ we
had already removed the edges from the update index.

We fix this by simply swapping the order: first we delete from the
update index, then we delete the edges themselves. A test ensuring that
the entires are cleared (which failed before this commit), has been
added.
2018-06-05 17:30:56 -07:00
Olaoluwa Osuntokun 4af9da40c5 htlcswitch: fix alignment in packetQueue for ARM
Fixes #1328.
2018-06-05 12:55:06 -07:00
Olaoluwa Osuntokun d98d4523e1 Merge pull request #1159 from wpaulino/onion-service-support
multi: add onion services support
2018-06-04 21:46:51 -07:00
Olaoluwa Osuntokun d2bcb708f3 server: demote 'sending message' log to trace 2018-06-04 19:50:44 -07:00
Olaoluwa Osuntokun cc12cf428b Merge pull request #1325 from Roasbeef/gossip-syncer-fixes
discovery: ensure gossiper syncer has idempotent exit/start, fix deadlock
2018-06-04 19:17:47 -07:00
Olaoluwa Osuntokun 3cb24e57cc Merge pull request #1324 from Roasbeef/fix-routing-hint-panic
rpc: ensure we don't attempt to create a routing hint with a nil edge
2018-06-04 18:46:00 -07:00
Olaoluwa Osuntokun b915da427b Merge pull request #1322 from Roasbeef/sync-feature-lazy-check
lnwire: only check payload for proper size if encoding type is sorted…
2018-06-04 18:42:38 -07:00
Olaoluwa Osuntokun 4d37508417 rpc: ensure we don't attempt to create a routing hint with a nil edge
In this commit, we fix an existing panic bug related to the recently
added routing hints feature. If it's the case that the remote node
didn't send us their edge, then when we go to compare the public keys to
see if they match, we may attempt to deref an nil pointer.

In order to fix this, we'll instead check the edgeInfo, which is
guaranteed to also exist if the channel was found in the database. As a
defensive step, before we go to actually aces the struct, we'll check
that's it's non-nil and proceed if it is nil.
2018-06-04 17:21:42 -07:00