Commit Graph

7888 Commits

Author SHA1 Message Date
Wilmer Paulino
83c8ccb3eb
chainntnfs/txnotifier: notify confirmations and spends of scripts at tip 2019-01-21 13:57:43 -08:00
Wilmer Paulino
ecd70deb8c
chainntnfs/txnotifer: detect confirmations and spends of scripts at tip
In this commit, we modify the TxNotifier's ConnectTip method to also
detect whether a registered script has been confirmed or spent on-chain
by a transaction in the connected block. Once detected, notifications
for them will be queued up for dispatch as with txids/outpoints.

We've also refactored the ConnectTip method into smaller and reusable
methods, which will serve useful later.
2019-01-21 13:57:43 -08:00
Wilmer Paulino
b579c23310
chainntnfs/txnotifier: support registration of scripts for spends 2019-01-21 13:57:43 -08:00
Wilmer Paulino
0f4ff2d09c
chainntnfs/txnotifier: support registration of scripts for confirmations 2019-01-21 13:57:43 -08:00
Wilmer Paulino
a0d3b7d9e3
chainntnfs: support caching confirm/spend hints for scripts
In this commit, we refactor the HeightHintCache and its underlying
interfaces to be able to manipulate hints for ConfRequests and
SpendRequests. By doing so, we'll be able to manipulate hints for
scripts if the request includes either a zero hash or a zero outpoint.
2019-01-21 13:57:43 -08:00
Wilmer Paulino
de0adc4d52
chainntnfs/txnotifier: add ConfRequest and SpendRequest structs
These structs allow us to request notifications for either
txids/outpoints or output scripts. We'll be using these in later commits
to index confirmation and spend requests within the TxNotifier.
2019-01-21 13:57:43 -08:00
Wilmer Paulino
cdf2a65db6
build: update deps to support detecting script spends within rescans 2019-01-21 13:57:43 -08:00
Johan T. Halseth
f48c8f91c4
lnd+pilot: use WeightedCombAttachment
We make the default autopilot agent use the WeightedCombAttachment.
Currently it uses only one sub-heuristic, prefAttachment.
2019-01-21 09:44:38 +01:00
Johan T. Halseth
bdbadeaa75
autopilot: add WeightedCombAttachment
This commit defines a new heuristic WeightedCombAttachment that takes a
set of sub-heuristics, and produces a final node score by querying the
sub-heuristics and combining the scores from them according to their
weights.

This way it will look like a regular, single heuristic to the autopilot
agemnt, but can be a more complex combination of several.
2019-01-21 09:44:38 +01:00
Johan T. Halseth
592ce92c72
autopilot/interface+prefattach: scale node scores to range [0.0, 1.0]
To prepare for combinning scores from multiple heuristics, we require the
scores returned from the NodeSores API to be in the range [0.0, 1.0].

The prefAttach heuristic is altered to scale the returned scores such
that the most connected node in the grpah is given a score of 1.0.
2019-01-21 09:44:37 +01:00
Alex Akselrod
66a150297a config: default to listening for p2p on localhost when tor enabled
When Tor is enabled, this change allows manual hidden service
configuration by defaulting to listening for p2p connections on
the loopback address. It also allows overriding this manually
for situations where the Tor daemon is running on another machine,
such as when using Whonix or OnionPi-like systems.
2019-01-18 22:45:31 -07:00
Alex Akselrod
288870f043 tor: add support for NULL authentication to controller
This change allows the Tor controller to request hidden service
configuration over unauthenticated Tor control ports, such as used
in Whonix.
2019-01-18 22:45:31 -07:00
Olaoluwa Osuntokun
4537c63dbd
Merge pull request #2504 from Roasbeef/vendor-with-release
build: update release.sh to contain vendor archive + source code
2019-01-18 19:16:36 -08:00
Olaoluwa Osuntokun
b7244244ae
peer: disconnect peers that don't have our required feature bits 2019-01-18 18:30:55 -08:00
Olaoluwa Osuntokun
9c344ec311
Merge pull request #2499 from Roasbeef/code-cont-replace
docs: add new section to contribution guidelines for go mod replace
2019-01-18 18:19:55 -08:00
Olaoluwa Osuntokun
aa5e3fed43
Merge pull request #2503 from cfromknecht/wtserver-reward-script
watchtower/wtserver/server: return valid reward script
2019-01-18 12:51:52 -08:00
Olaoluwa Osuntokun
df45cc19a3
build: update release.sh to contain vendor archive + source code
In this commit, we update the release script to include a directory
containing all of our vendored dependencies. This makes out releases
more self contained as they can be built using `go build -mod=vendor`
without requiring any package fetching.

Additionally, we pacakge the entire source as well.

Fixes #1550.
2019-01-17 23:40:11 -08:00
Conner Fromknecht
f78319d32c
watchtower/wtserver/server: return valid reward script 2019-01-17 22:19:28 -08:00
Conner Fromknecht
7e1b399437
Merge pull request #2494 from halseth/make-flakehunter-build-itest
[trivial] build lnd-itest before flakehunting
2019-01-17 19:22:01 -08:00
Olaoluwa Osuntokun
c815821679
server: require the DLP bit for all incoming/outgoing connections
In this commit, we modify our default local feature bits to require the
Data Loss Protection (DLP) feature to be active. Once full Static
Channel Backups are implemented, if we connect to a peer that doesn't
follow the DLP protocol, then the SCBs are useless, as we may not be
able to recover funds. As a result, in prep for full SCB deployment,
we'll now ensure that any peer we connect to, knows of the DLP bit. This
could be a bit more relaxed and allow _connections_ to non-DLP peers,
but reject channel requests to/from them. However, this implementation is
much simpler.
2019-01-17 16:53:43 -08:00
Olaoluwa Osuntokun
9cda05ee8a
docs: add new section to contribution guidelines for go mod replace
In this commit, we add a new section to the code contribution guidelines
explaining how to use `go mod replace`. This will be a common procedure
for any developer that needs to make a change in any of our sister
projects, so it's nice to have this outlined in a single place.
2019-01-17 16:50:06 -08:00
Olaoluwa Osuntokun
c3ebe6c77d
Merge pull request #2402 from Roasbeef/update-install-directions
docs/INSTALL.md: update Go installation options for Linux
2019-01-17 16:33:06 -08:00
Johan T. Halseth
4cbc6e6e07
make: build lnd-itest before flakehunting 2019-01-17 14:40:20 +01:00
Johan T. Halseth
8af2473644
channeldb/addr_test: add tests for invalid onion addresses 2019-01-17 14:16:15 +01:00
Johan T. Halseth
6a3e1423d2
channeldb/addr: sanity check onion address length before writing to db 2019-01-17 14:16:15 +01:00
Johan T. Halseth
e2e00f9dd2
channeldb/addr_test: add invalid TCP cases
These are invalid length IP addresses that earlier would not fail to
serialize.
2019-01-17 14:16:15 +01:00
Johan T. Halseth
02b7bb356a
channeldb/addr: validate ip before writing 2019-01-17 14:16:12 +01:00
Johan T. Halseth
6f605b2de2
channeldb/addr_test: inspect error string
Lets us match on more than static errors.
2019-01-17 14:14:24 +01:00
Joost Jager
6ae55168b8
Merge pull request #2486 from joostjager/split-resolvers
cnct: split resolvers in separate files
2019-01-17 08:57:22 +01:00
Olaoluwa Osuntokun
099d260318
Merge pull request #2320 from cfromknecht/wtpolicy
[watchtower] add wtpolicy.Policy and wtserver message logging
2019-01-16 14:05:59 -08:00
Olaoluwa Osuntokun
32a5f6821a
Merge pull request #1621 from halseth/integration-tests-split-backend-miner
[Integration tests] Split chain backend and miner
2019-01-16 14:02:52 -08:00
Joost Jager
4ec3fc3b1a
cnct: split resolvers in separate files 2019-01-16 20:03:59 +01:00
Johan T. Halseth
5dc87ad4d7
gitignore: ignore .minerlogs folder 2019-01-16 10:11:47 +01:00
Johan T. Halseth
2b16fb7271
lnd_test: fix reorg test by using new Node RPC
Since the chain backend and miner is now seperate nodes, the reorg test
must be slightly rewritten. We use the Btcd Node RPC to connect and
disconnect the three bitcoin nodes in question (chain backend, miner,
temp miner) to control the reorg scenario.
2019-01-16 10:10:22 +01:00
Johan T. Halseth
92b984a233
lnd_test+lntest: seperate miner and chain backend
Since we are no longer passing in the miner as the chain backend, we
don't have to export the fields.
2019-01-16 10:10:22 +01:00
Johan T. Halseth
989fe50da8
lntest: define BackendCfg and btcd impl
BackendCfg is an interface that can be backed by different Bitcoin node
implementations. We currently use the btcdHarness as our chain backend.
2019-01-16 09:44:29 +01:00
Olaoluwa Osuntokun
cb1df51a3a
Merge pull request #2479 from wpaulino/signer-server-compilation-fix
lnrpc/signrpc/signer_server: fix incorrect lnwallet.InputScript field
2019-01-15 21:39:45 -08:00
Olaoluwa Osuntokun
5b2afaff8f
Merge pull request #2448 from cfromknecht/watchtower-pkg
watchtower pkg
2019-01-15 20:01:50 -08:00
Conner Fromknecht
45cfa65b47
watchtower/wtserver/server: handle missed err case from read msg 2019-01-15 19:46:04 -08:00
Conner Fromknecht
4a2fb1b4d0
watchtower/wtserver/server: log sent/recvd wire messages 2019-01-15 19:38:41 -08:00
Conner Fromknecht
00db396b51
watchtower/wtwire/summary: adds message summaries 2019-01-15 19:38:41 -08:00
Olaoluwa Osuntokun
53a181ce49
Merge pull request #2439 from cfromknecht/wtpolicy-blob-type
wtpolicy: migrate to using wtpolicy.Policy + blob bitvector flags
2019-01-15 19:30:56 -08:00
Wilmer Paulino
3420d6d917
lnrpc/signrpc/signer_server: fix incorrect lnwallet.InputScript field 2019-01-15 19:27:28 -08:00
Olaoluwa Osuntokun
8bde0e736f
Merge pull request #2473 from Roasbeef/list-channels-initiator
lnrpc+rpc: add initiator field to listchannels
2019-01-15 18:29:13 -08:00
Olaoluwa Osuntokun
7df0e6fafe
Merge pull request #2466 from yancyribbens/enable-docker-mainnet
enable btcd and btcctl mainnet to be invoked from docker
2019-01-15 16:59:42 -08:00
Olaoluwa Osuntokun
114f0a8918
rpc: populate new initiator field in ListChannels response 2019-01-15 16:51:35 -08:00
Olaoluwa Osuntokun
5d0a371a7d lnrpc: add Initiator field to ListChannels resposne 2019-01-15 16:51:00 -08:00
Olaoluwa Osuntokun
b700b969e8
Merge pull request #2463 from wpaulino/notify-when-offline
server: implement notifications for disconnected peers
2019-01-15 16:47:29 -08:00
Olaoluwa Osuntokun
509bed614c
Merge pull request #2198 from Roasbeef/sendall-rpc
multi: add ability to sweep all coins in the the wallet to an addr to sendcoins
2019-01-15 14:49:17 -08:00
Wilmer Paulino
cbce6e03fc
server: implement notifications for disconnected peers 2019-01-14 22:44:45 -08:00