Commit Graph

3531 Commits

Author SHA1 Message Date
Conner Fromknecht
02c65db0d1 htlcswitch/link_test: integrate new channel update APIs 2018-03-09 17:35:54 -08:00
Conner Fromknecht
1fe7c6d431 htlcswitch/link: integrate persistence changes to lnwallet APIs 2018-03-09 17:35:53 -08:00
Conner Fromknecht
d420266911 lnwallet/channel: expose API changes to channel state transitions 2018-03-09 17:35:53 -08:00
Olaoluwa Osuntokun
7bad5458d7 Merge pull request #777 from cfromknecht/fwdpkg-staging
Switch Persistence [2/4] Infra for Forwarding Packages
2018-03-09 16:15:46 -08:00
Olaoluwa Osuntokun
759d2c9134 Merge pull request #665 from wilmerpaulino/close-all-channels
cmd/lncli: add closeallchannels command
2018-03-09 15:52:21 -08:00
Conner Fromknecht
6a88ff940a htlcswitch_/test_utils: init OpenChannels w/ Packager 2018-03-09 14:45:31 -08:00
Conner Fromknecht
970006ff2a breacharbiter_test: init open channels with Pacakager 2018-03-09 14:45:30 -08:00
Conner Fromknecht
6e542d5dfa lnwallet/channel_test: init open channels with Packager 2018-03-09 14:45:30 -08:00
Conner Fromknecht
53e4422a2e lnwallet/channel: integrate fwdpkgs w/ in-mem buffering 2018-03-09 14:45:30 -08:00
Conner Fromknecht
7a93c7530c channeldb/invoices: add idempotency to SettleInvoice 2018-03-09 14:45:30 -08:00
Conner Fromknecht
e4d2958f68 channeldb/channel_test: init with Pacakager and construct FwdPkgs 2018-03-09 14:45:30 -08:00
Conner Fromknecht
2df9fb5510 channeldb/channel: adds fwding package to channeldb 2018-03-09 14:45:30 -08:00
Conner Fromknecht
d18c317220 channeldb/forwarding_package_test: test PkgFilter 2018-03-09 14:45:29 -08:00
Conner Fromknecht
41c40a9560 channeldb/forwarding_package: initial fwdpkg 2018-03-09 14:45:29 -08:00
Olaoluwa Osuntokun
e184bbcb54 funding: don't case to a net.TCPAddr to support tor stream isolation
In this commit, we fix an existing bug in the funding manager, that can
be triggered if the user is connecting to a node over Tor, and then
attempts to open a channel. An existing fix was added for the case that
the receiving node established the channel, but this now makes that case
symmetric.
2018-03-09 14:22:23 -08:00
Wilmer Paulino
5705da92f6 cmd/lncli: add closeallchannels command
In this commit, we add a new closeallchannels command to lncli. This
command allows us to close all existing active and inactive channels
by closing them cooperatively or unilaterally, respectively.
2018-03-09 12:05:43 -05:00
Olaoluwa Osuntokun
51a3cab39c htlcswitch: fix race in forwarding log test by grabbing log mtx 2018-03-08 20:11:49 -08:00
Olaoluwa Osuntokun
649be5ee0b Merge pull request #775 from cfromknecht/sphinx-replay
Switch Persistence [1/4]: Infra for Sphinx Batched Decoding and Replay Protection
2018-03-08 23:03:01 -05:00
Olaoluwa Osuntokun
855e85511e Merge pull request #779 from Roasbeef/unsigned-msat-and-fee-fixes
lnwire+lnwallet+htlcswitch: modify lnwire.MilliSatoshi to be unsigned, fix fee related bugs that emerged
2018-03-08 22:28:16 -05:00
Conner Fromknecht
e1745f72aa lnd_test: bump async bidrect timeout to account sphinx replay writes 2018-03-08 21:12:05 -05:00
Conner Fromknecht
a4d8b30367 server: initialize server with persistent sphinx router 2018-03-08 21:12:05 -05:00
Conner Fromknecht
c2ec3a6ef5 htlcswitch/test_utils: use new ErrorEncrypter and HopIterator ifaces 2018-03-08 21:12:05 -05:00
Conner Fromknecht
5cbdb29bcc htlcswitch/link_test: mock extracting of error encrypter from onion pkt 2018-03-08 21:12:04 -05:00
Conner Fromknecht
06fb524a3b htlcswitch/mock: update mock obfuscator and iterators w/ new sphinx API 2018-03-08 21:12:04 -05:00
Conner Fromknecht
27df8d8ad1 htlcswitch/link: extract error encrypter from hop iterator 2018-03-08 21:12:04 -05:00
Conner Fromknecht
f075905d6c htlcswitch/iterator: use batch API for sphinx router 2018-03-08 21:12:04 -05:00
Conner Fromknecht
fcf08382f7 htlcswitch/failure: add Encode/Decode to ErrorEncrypter 2018-03-08 21:12:03 -05:00
Conner Fromknecht
9b4b4778f4 glide: update to most recent batch replay 2018-03-08 21:11:12 -05:00
Olaoluwa Osuntokun
30c92ea7f1 Merge pull request #808 from cfromknecht/upd-btcwallet-for-deadlock-fix
update btcwallet+keychain to include waddrmgr deadlock fix
2018-03-08 21:04:30 -05:00
Conner Fromknecht
df99882648 keychain/btcwallet: convert Locked() -> IsLocked() 2018-03-08 20:07:27 -05:00
Conner Fromknecht
fe7705efec glide: update btcwallet to include waddrmgr deadlock fix
This commit bumps the version of btcwallet used in lnd
to incorporate a fix for a reentry deadlock observed during
address creation.

For more information see:
  https://github.com/Roasbeef/btcwallet/pull/18/
2018-03-08 20:07:27 -05:00
Olaoluwa Osuntokun
97b7eb226d lnrpc: update photo comments to fix api.lightning.community tool 2018-03-08 17:06:34 -08:00
Olaoluwa Osuntokun
8d35ea381e zpay32: remove test case with negative amt 2018-03-08 12:50:50 -05:00
Olaoluwa Osuntokun
7031b5d217 htlcswitch: modify forwarding fee assertion to compare emperical fees
In this commit, we fix a bug that was uncovered by the recent change to
lnwire.MilliSatoshi. Rather than manually compute the diff in fees,
we’ll directly compare the fee that is given against the fee that we
expect.
2018-03-08 12:50:49 -05:00
Olaoluwa Osuntokun
b8d0df998a lnwallet: when validating fee updates, ensure newFee < balance 2018-03-08 12:50:49 -05:00
Olaoluwa Osuntokun
ac90a8288e lnwallet: precalculate fees in mSAT to avoid multiple conversions 2018-03-08 12:50:49 -05:00
Olaoluwa Osuntokun
217166fb10 lnwallet: within validateCommitmentSanity check for balance underflow
In this commit, we add an additional check within
validateCommitmentSanity due to the recent change to unsigned integers
for peer balances in the channel state machine. If after evaluation
(just applying HTLC updates), the balances are negative, then we’ll
return ErrBelowChanReserve.
2018-03-08 12:50:48 -05:00
Olaoluwa Osuntokun
5f5e4554cb lnwallet: if the initiator is unable to pay fees, then consume their entire output
In this commit, we add logic to account for an edge case in the
protocol. If they initiator if unable to pay the fees for a commitment,
then their *entire* output is meant to go to fees. The recent change to
properly interpret balances as unsigned integers (within the protocol)
let to the discovery of this missed edge case.
2018-03-08 12:50:48 -05:00
Olaoluwa Osuntokun
19bc477b9a lnwallet: update interface tests to account for recent lnwire.MilliSatoshi change
lnwire.MilliSatoshi is now a signed integer, as a result, we’ll return
a different error if our balances go to negative due to the inability
to pay a the set fee.
2018-03-08 12:50:48 -05:00
Olaoluwa Osuntokun
8425a35684 lnwallet: in NewChannelReservation ensure commit fees are payable
In this commit, we fix a bug introduced by the recent change of
lnwire.MilliSatoshi to be an unsigned integer. After this change an
integer underflow was left undetected, as a result we’ll now
momentarily cast to a signed integer in order to ensure that both sides
can pay the proper fee.
2018-03-08 12:50:47 -05:00
Olaoluwa Osuntokun
5ecef17e0f lnwallet: modify logging to display mSAT amount if funding constrains invalid 2018-03-08 12:50:47 -05:00
Olaoluwa Osuntokun
f83d56c91f lnwire: modify lnwire.MilliSatoshi to be an unsigned integer
In this commit, we modify lnwire.MilliSatoshi to be an unsigned
integer. We do this as all values within the specification are meant to
be unsigned unless otherwise specified. Our usage of signed integers to
this date has caused some compatibility issues with the other
implementations, so this is the first step to reconciling these
compatibility issues.
2018-03-07 13:29:58 -05:00
Olaoluwa Osuntokun
116406c7ec Merge pull request #769 from Roasbeef/new-lightning-key-derivation
multi: modify key derivation to be fully deterministic, remove p2pkh, wallet now witness only
2018-03-06 17:21:55 -05:00
Olaoluwa Osuntokun
1c5f1885d9 Merge pull request #784 from halseth/protocol-errors
Wire protocol errors
2018-03-06 16:54:49 -05:00
Olaoluwa Osuntokun
18e9475a9a lnwallet/btcwallet: grab best header timestamp directly from wallet
In this commit, we modify the way we obtain the current best header
timestamp. In doing this, we fix an intermittent flake that would pop
up at times on the integration tests. This could occur as if the wallet
was lagging behind the chain backend for a re-org, then a hash that the
backend knew of, may not be known by the wallet.

To remedy this, we’ll take advantage of a recent change to btcwallet to
actually include the timestamp in its sync state.
2018-03-06 16:04:07 -05:00
Olaoluwa Osuntokun
78cbe7a141 lnd: verify proper keychain derivation version upon initial creation 2018-03-06 16:04:06 -05:00
Olaoluwa Osuntokun
dc2404f289 contractcourt: update test due to recent SignDescriptor API changes 2018-03-06 16:04:06 -05:00
Olaoluwa Osuntokun
d98e7a730d lnwallet: update integration tests due to recent API changes 2018-03-06 16:04:06 -05:00
Olaoluwa Osuntokun
7edca37918 build: update to use latest btcwallet with scoped key managers 2018-03-06 16:04:05 -05:00
Olaoluwa Osuntokun
9981c4ce38 lnd: populate the secret key ring in the lnwallet config 2018-03-06 16:04:05 -05:00