Commit Graph
100 Commits
Author SHA1 Message Date
Olaoluwa Osuntokun 6dcefac868 lnwire: update CommitRevocation for revoke key scheme
With this commit a revocation message now carries 3 items:

  1. A pre-image revoking the lowest unrevoked commitment transaction
in the commitment chain.
  2. A new key which extends the current revocation window by 1. This
key is to be used for new commitment transactions.
  3. A new hash which also extends the current revocation window by 1.
This hash is to be used for new HTLC revocation hashes.
2016-06-30 11:59:46 -07:00
Olaoluwa Osuntokun 7c7ed5e638 lnwire: add a LogIndex field to CommitSignature
This commit updates the CommitSignature message to match the latest
version of the state-machine protocol. The log index specifies up to
which index in the receiver’s HTLC log the sender’s signature covers.
2016-06-30 11:58:39 -07:00
Olaoluwa Osuntokun bba9b665ef lnwire: all hashes within the protocol are now 32-bytes
We now enforce that the site of all revocation pre-images+hashes (used
for HTLC’s) are now 32-bytes.

Additionally, all payment pre-images are now required to be 32-bytes
not he wire. There also exists a Script level enforcement of the
payment pre-image size at a lower level.

This commit serves to unify the sizes of all hashes/pre-images across
the codebase.
2016-06-30 11:53:21 -07:00
Olaoluwa Osuntokun fd02c1c1aa lnwire: update single funder workflow to use revocation keys
This commit updates the messages sent during a single funder workflow
to utilize revocation keys rather than revocation hashes. This now
matches the latest updates to the commitment transaction.

The changes to the workflow are as follows:
  * the response message now carries the responder’s revocation key
  * the complete message now carries the initiator’s revocation key

Once the initiator receives the response message, it can construct both
versions of the commitment transaction as it now knows the responder’s
commitment key. The initiator then sends their initial revocation key
over to the responder allowing it to construct the commitment
transactions and give the initiator a sig for their version.
2016-06-30 11:50:27 -07:00
Olaoluwa Osuntokun 582b83ada3 channeldb: update channel state to revocation keys + new elkrem API
This commit updates the stored on-disk channel state to store a current
revocation key rather than a revocation hash. This change coincides
with the new commitment transaction format which uses revocation keys
rather than hashes.

Additionally, this commit updates the decoding/encoding of local+remote
elkrem trees to the latest changes in the elkrem API.
2016-06-30 11:40:12 -07:00
Olaoluwa Osuntokun 381474fc8e elkrem: add method to export sender root
As noted in the comment on the method, this serialization method isn’t
strictly necessary assuming the root is derived via a cryptographically
secure, yet deterministic procedure. The method is supplied only for
convenience.
2016-06-30 11:34:53 -07:00
Olaoluwa Osuntokun 14f12fbb7d elkrem: remote commented out encode/decode for sender 2016-06-30 11:32:11 -07:00
Olaoluwa Osuntokun 102a0f6689 elkrem: sync with upstream onehop branch
This commit syncs the version of elkrem currently checked into master
with the version that has been developed in the upstream master branch.
2016-06-29 16:55:49 -07:00
Olaoluwa Osuntokun 96667cbc4a cmd/lncli: update action func to new upstream signature
The upstream cli repo has changed the signature for the ‘Action’ to
return an additional error. Thankfully this was done in a backwards
compatible manner.

This commit updates all the command action functions to adhere to the
new function signature.

In the future we’ll have proper dependency management so cases like
this will be avoided all together.
2016-06-29 13:01:40 -07:00
Olaoluwa Osuntokun f7543b39a4 lnstate: remove package
This commit removes the lnstate package. The package was originally
created by Joseph to draft some ideas he was developing w.r.t to the
Lightning Network link-layer protocol. However, we recently *completely
re-designed* the protocol after an involved white-board session.
Therefore, this package can now be removed as it’s obsolete.

A series of commits will be landing in the near future which implement,
test, and hookup this new and improved wire protocol.
2016-06-29 11:33:56 -07:00
Olaoluwa Osuntokun f3a6f8ffe6 lnd: implement the sendcoins RPC request
This commit implements the “send coins” RPC request which was
introduced at both the lnrpc and command line level in a prior commit.

A small refactoring has taken place w.r.t to sendmany+sendcoins in
order to eliminate some code duplication.
2016-06-29 11:31:34 -07:00
Olaoluwa Osuntokun e391cf088e cmd/lncli: add support for the sendcoins RPC 2016-06-29 11:29:29 -07:00
Olaoluwa Osuntokun 6e5fb13a0d lnrpc: add new SendCoins RPC to service
This commit adds a new RPC to the RPC server: “sendcoins”. This RPC is
identical to “sendmany” with one small change: the level of send
parallelization is 1. This is useful when one wishes to simply send
coins to a friend and/or a payment.
2016-06-29 11:28:23 -07:00
Olaoluwa Osuntokun e22734f9cf lnwallet: update HTLC+commitment scripts
This commit updates the previous HTLC and commitment scripts to their
current latest evolution.

The HTLC scripts have been optimized for space savings, the
functionality itself has remained relatively unchanged. A trade off was
made to add additional bytes into the sigScript in order to avoid
extraneous CHECKSIG’s. The rationale is that an extra 1-2 bytes in the
sigScript to guide execution, are worthwhile since they’re in the
witness, and witness data may be pruned in the near future.

The primary change is within the commitment transaction itself. Instead
of using revocation hashes, we now use signature based revocation. This
saves space in the Script, and optimizes away an extra hashing
operation. Elkrem/shachain is still used but, we now use the pre-images
to homomorphically derive a public key which the other party will be
able to sign with, once we disclose the pre-image itself.

Finally, we have switched to using SHA-256 everywhere uniformly for
both revocation hashes, and payment hashes. The rationale is that the
output of ripemd160 is too small for modern security margins, and that
other coins/chains are more likely to have SHA-256 implemented, than
ripemd160.

A set of tests has also been included which contain (mostly) exhaustive
tests of all possible redemption paths for both commitment and HTLC.
2016-06-27 11:35:32 -07:00
Olaoluwa Osuntokun ac8736ff99 lnwallet: convert commitment no-delay output to p2wsh 2016-06-27 11:21:13 -07:00
Olaoluwa Osuntokun 05fb9b5a6d lnwallet: payment and revocation hashes are now 32 bytes
This unifies some inconstancies across the code-base with hashes being
32 vs 20 bytes. All hashes, whether payment or revocation are now
uniformly 32 bytes everywhere. As a result, only OP_SHA256 will be used
within commitment and HTLC scripts. The rationale for using sha256
instead of hash160 for the HTLC payment pre-image is that alternative
chains are more likely to have sha256 implemented, rather than
ripemd160.

A forthcoming commit will update the current commitment, and HTLC
scripts.
2016-06-26 23:04:14 -07:00
Olaoluwa Osuntokun 1a48db3039 channeldb: stored un-revoked hashes are now 32 bytes 2016-06-26 22:59:02 -07:00
Olaoluwa Osuntokun 914159cb87 lnd: list active channels in response to listpeers cmd 2016-06-22 22:22:44 -07:00
Olaoluwa Osuntokun e61a03a372 lnd: add support for channel state snapshots in peer 2016-06-22 22:22:09 -07:00
Olaoluwa Osuntokun 2e706f39b9 lnd: delete channel state from db after close 2016-06-22 22:20:37 -07:00
Olaoluwa Osuntokun 77a006f03b lnwallet: ChannelPoint() now returns a pointer to outpoint 2016-06-22 22:15:13 -07:00
Olaoluwa Osuntokun e17bdf08ea lnwallet: expose db channel deletion+snapshotting 2016-06-22 22:12:37 -07:00
Olaoluwa Osuntokun 2ea21422b5 lnrpc: make remote_id and channel_point strings in ActiveChannel 2016-06-22 22:06:42 -07:00
Olaoluwa Osuntokun b88b2d4c91 channeldb: implement snapshots for active channels 2016-06-22 22:05:53 -07:00
Olaoluwa Osuntokun 07bc7bbd42 channeldb: sent internal db pointer in FetchOpenChannels
This commit fixes a bug which would potentially cause a panic if a
channel returned from FetchOpenChannels attempted to access the
internal pointer to the database.

To fix this bug, the pointer is now properly set once the channel has
been loaded from the database.
2016-06-22 22:01:32 -07:00
Olaoluwa Osuntokun 6b53b393df cmd/lncli: add json attribute tag for anonymous ChannelPoint struct 2016-06-22 21:48:39 -07:00
Olaoluwa Osuntokun 210c32d890 channeldb: add doc strings to finalize funcs/structs 2016-06-22 17:15:52 -07:00
Olaoluwa Osuntokun f1f27b2046 channeldb: add ability to close active channels
This commit introduces the concept of “closing” an already active
channel. Closing a channel causes all the channel state to be purged
from the database, and also triggers the creation of a small “summary”
kept concerning details of the previously open channel.

This commit also updates the previous test case(s), and includes the
close channel bucket in the database deletion in the .Wipe() method.
2016-06-22 16:16:43 -07:00
Olaoluwa Osuntokun 7e09a70706 cmd/lncli: properly reverse user txid input
This commit fixes a bug introduced within a prior commit. The prior
commit failed to drollery reverse the txid string taken in as user
input, therefore in order to properly close a channel, the user needed
to manually reverse the txid themselves.

With this change, `wire.NewShaHashFromStr` is used which properly
reverses the string within the constructor. This allows the string
reported not be directly used to the close an active channel.

This commit also corrects a few logging messages.
2016-06-22 11:10:33 -07:00
Olaoluwa Osuntokun 8066195d23 cmd/lncli: implement remaining RPC commands
Currently positional arguments *are not* supported, and all arguments
must be passed via unix-style command line arguments.

In a later commit support for concurrent positional, and manually
specified arguments will be added.
2016-06-21 13:14:19 -07:00
Olaoluwa Osuntokun cf32b07f61 lnrpc: recompile protobufs to new RPC spec 2016-06-21 13:14:10 -07:00
Olaoluwa Osuntokun 1188fd2bf6 lnd: implement open+close channel workflow in daemon
This commit adds the necessary plumbing within the server, peer, and
rpcServer to handle opening and cooperatively closing a channel with a
remote peer.

Many new data structures have been added to the peer in order to allow
it to efficiently manage opening+.losing new/existing lightning
channels. Additional documentation has been added to several methods
within the peer struct, with some minor renaming along with way. The
peer has also gained a dedicated goroutine whose job it is to manage
any requests pertaining to opening, or closing any channels with the
remote peer.

The messages have been added to lnrpc define the requests and responses
to channel open+close messages. Additional channel logic has been added
between the rpcServer, peer, and server in order to properly manage the
necessary synchronization.
2016-06-21 13:14:05 -07:00
Olaoluwa Osuntokun 9ef7e23384 lnd: implement connectpeer and listpeers RPC calls 2016-06-21 13:14:01 -07:00
Olaoluwa Osuntokun c7e9bb8c58 lnrpc: implement wallet balance RPC call 2016-06-21 13:13:57 -07:00
Olaoluwa Osuntokun 9c0566cb42 lnd: create logger for fundingManger add closures 2016-06-21 13:13:53 -07:00
Olaoluwa Osuntokun 31e5466692 lnd: introduce the fundingManager
This commit introduces the fundingManger which is used as a bridge
between the wallet’s internal ‘ChannelReservation’ workflow, and the
wire protocol’s funding messages.

 The funding manger is responsible for progressing the workflow, and
communicating any errors generated during the workflow back to the
source peer.
2016-06-21 13:13:49 -07:00
Olaoluwa Osuntokun 25577b6cd5 lnwallet: add test cases for single funder workflow
This commit adds additional test cases to test both cases (initiator vs
responder) for a single funder channel workflow. Additionally, the
previous dual funder tests have been extended in order to detect proper
funding channel broadcast, and the ChainNotifier’s role in notifying
upstream callers that a funding transaction has been embedded in the
chain at a sufficient depth.

At this point the tests certainly need to be cleaned up. bobNode should
be replaced with a second instance of the wallet modeling a remote
peer.
2016-06-21 13:13:45 -07:00
Olaoluwa Osuntokun 3a14fe8ba5 lnwallet: add support for single funder workflow
This commit modifies the existing workflow to add additional paths to
be used when on the responding side of a single funder workflow.

Additionally, several bugs encountered within the existing dual funder
workflow logic have been fixed, and modified to account for the wallet
being on the igniting side of a single funder workflow.
2016-06-21 13:13:41 -07:00
Olaoluwa Osuntokun 4a6a2d6cd4 lnwallet: correct inputs scripts for nested P2SH spend
The previous logic incorrectly assumed the returned address was already
a p2wkh address. Instead, a p2sh address was returned. So we now
correctly craft both the sigScript and witness stack for a nested p2sh
spend.
2016-06-21 13:13:33 -07:00
Olaoluwa Osuntokun d52955b146 lnwallet: extract coin selection to distinct method
This is required since for single funder channels, we don’t contribute
any funds so we don’t need to select any change or coins for input into
the funding transaction.
2016-06-21 13:13:29 -07:00
Olaoluwa Osuntokun e62fc414cb lnwallet: add single funder workflow to ChannelReservation
This commit adds 3 methods to lnwallet.ChannelReservation intended to
facilitating a single funder channel workflow between two nodes. A
single funder workflow is characterized as the initiator committing all
the funds to a channel, with the responder only providing public keys,
and a revocation hash.

The workflow remains the same for the initiator of the funding
transaction, however for the responder, the following methods are
instead called in order:
  * .ProcessSingleConribution()
  * .CompleteSingleContribution()
  * .FinalizeReservation()

These methods are required for the responder as they are never able to
construct the full funding transaction, and only receive the out point
of the funding transaction once available.
2016-06-21 13:13:26 -07:00
Olaoluwa Osuntokun 45236fa092 lnwallet: implement cooperative closure for LightningChannel
A cooperative closure of a LightningChannel proceeds in two steps.
First, the party who wishes to close the channel sends a signature for
the closing transaction. Next, the responder reconstructs the closing
transaction identically as the initiator did using a canonical
input/output ordering, and the currently settled balance within the
channel. At this point, the responder then broadcasts the closure
transaction. It is the responsibility of the initiator to watch for
this transaction broadcast within the network to clean up any resources
they committed to the active channel.
2016-06-21 13:13:22 -07:00
Olaoluwa Osuntokun 27e6839060 lnwallet: publicly export constructor for LightningChannel 2016-06-21 13:13:18 -07:00
Olaoluwa Osuntokun 507520cda9 lnwallet: move channelState from channeldb to channel.go 2016-06-21 13:13:14 -07:00
Olaoluwa Osuntokun 3c11006b12 lnwire: add forgotten godoc comment for SFR 2016-06-21 13:13:10 -07:00
Olaoluwa Osuntokun 6c7880ef76 lnwire: channels are now identified by outpoint
This commit modifies most of the wire messages to uniquely identify any
*active* channels by their funding output. This allows the wire
protocol to support funding transactions which open several channels in
parallel.

Any pending channels created by partial completion of the funding
workflow are to be identified by a uint64 initialized by both sides as
follows: the initiator of the connection starts from 0, while the
listening node starts from (1 << 63). These pending channel identifiers
are expected to be monotonically increasing with each new funding
workflow between two nodes. This identifier is volatile w.r.t to each
connection initiation.
2016-06-21 13:13:07 -07:00
Olaoluwa Osuntokun 7b7d572984 lndc: fix bug in pubkeyhash based authentication
The call to copy used incorrect slicing on `greetingMsg` which caused
the remote node to always reject the auth attempt as all zeroes
(0000..) was being sent as the local node’s guess to the remote node’s
public key identity.
2016-06-21 13:13:03 -07:00
Olaoluwa Osuntokun 7801c940df lndc: use hex encoding method .String() method 2016-06-21 13:12:59 -07:00
Olaoluwa Osuntokun 32b8c5b848 lnd: fix bug causing help (./lnd -h) to be printed twice 2016-06-21 13:12:55 -07:00
Olaoluwa Osuntokun cad0d54e43 lnd: make the http profiling server optional w/ a config param 2016-06-21 13:12:51 -07:00
Olaoluwa Osuntokun c5f97a17d5 channeldb: introduce FetchOpenChannels
This commit introduces/re-writes a method FetchOpenChannels for
channeldb, which returns all currently active/open channels for a
particular peerID.
2016-06-21 13:12:47 -07:00
Olaoluwa Osuntokun c2818a549b channeldb: modify schema to multiple-channels-per-peer
This commit overhauls the current schema for storing active channels in
order to support tracking+updating multiple open channels for a
particular peer.

Channels are now uniquely identified by an output (txid:index) rather
than an arbitrary hash value. As a result, the funding transaction is
no longer stored, as only the txin is required to lookup the original
transaction, and to sign for new commitment states.

A new bucket, nested within the bucket for a node’s Lightning ID has
been created. This new bucket acts as an index to the active channels
for a particular peer by storing all the active channel points as keys
within the bucket. This bucket can then be scanned in a linear fashion,
or queried randomly in order to retrieve channel information.

The split between top-level, and channel-level keys remains the same.
The primary modification comes in using the channel ID (the funding
outpoint) as the key suffix for all top-level and channel-level keys.
2016-06-21 13:12:43 -07:00
Olaoluwa Osuntokun 43c84c2ce5 chainntfs: include height in spending+conf notifications 2016-06-21 13:12:39 -07:00
Olaoluwa Osuntokun 7bff2e07a8 chainntfs: add new RegisterBlockHeightNtfn method
This commit adds a new method to the ChainNotifier interface which
subscribes the caller to a continuous stream of notifications generated
by new blocks added to the tip of the Bitcoin main chain.

Concurrently, this method is intended to be used in order to obtain the
necessary block height information to properly handle the timeout
period on any pending HTLCs. A continuos stream, rather than a one-off
notification is chosen in order to discourage a goroutine-per-HTLC
model which would be rather wasteful.
2016-06-21 13:12:35 -07:00
Olaoluwa Osuntokun 1879c00c55 chainntfs: further specify behavior of RegisterSpendNtfn
This commit updates the documentation for the chainntfs interface to
specify that notifications for spends registered with
`RegisterSpendNtfn` should be triggered *only* once a transaction
spending the target outpoint is *seen* within the network.

This strictness is required in order to allow an ‘honest’ counter-party
to properly sweep funds within channels with short delays.
2016-06-21 13:12:31 -07:00
Olaoluwa Osuntokun 3f0173f19a chainnfts: export logger for use by concrete implementations 2016-06-21 13:12:27 -07:00
Olaoluwa Osuntokun 3b6e456371 lnwire: revamp previous encode/decode tests to passing state 2016-05-30 20:52:25 -07:00
Olaoluwa Osuntokun 83b11c5efe lnwire: fix writeElement [][20]byte bug
Passing the [20]byte as a *[20]byte results in a type switch error as
there isn’t a case for that type within writeElement.
2016-05-30 20:52:17 -07:00
Olaoluwa Osuntokun 4d763e07f7 lnwire: add basic encode/decode tests for single funder workflow 2016-05-30 20:52:13 -07:00
Olaoluwa Osuntokun 9978d889b7 lnwire: add missing cases in [read/write]Element
Add cases to encode/decode wire.OutPoint, and a final line to properly
write out signatures fully.
2016-05-30 15:45:01 -07:00
Olaoluwa Osuntokun 61994bc294 Merge pull request #12 from RCasatta/master
Updating Readme with reference to Segnet4 instead of testnet-L
2016-05-23 13:59:51 -07:00
Olaoluwa Osuntokun 913ae259de lnwire: document commitment+HTLC update msgs
This commit adds some cursory documentation along wit minor field
modifications to all messages which deal with adding HTLC’s, or
updating remote commitment transactions.

The messages for dual funding of channel is left purposefully
undocumented as all initial negotiations will be single funder by
default.

A revamp of the testing infrastructure of lnwire will be committed in
the near future.
2016-05-23 13:54:41 -07:00
Olaoluwa Osuntokun b202831868 lnwire: update/document [read/write]Element funcs 2016-05-23 13:51:26 -07:00
Olaoluwa Osuntokun 2073fa42a7 lnwire: document lnwire specific data structures 2016-05-23 13:50:39 -07:00
Olaoluwa Osuntokun a30831aef8 lnwire: update and document message.go 2016-05-23 13:49:14 -07:00
Olaoluwa Osuntokun 0563205e6d lnwire: update isValidPkScript for segwit scripts 2016-05-23 13:48:17 -07:00
Olaoluwa Osuntokun 8dc284db02 lnwire: update tests to new wire.TxIn API
Syncing to match upstream btcd segwit branch.
2016-05-23 13:47:29 -07:00
Olaoluwa Osuntokun 1a617fcccb lnwire: add SingleFundingOpenProof message
The SFOP is the final message sent during the single funding channel
negotiation protocol. Once Alice sends the SFOP message to Bob, Bob
will then commit resources to watching and updating the newly created
channel with Alice.
2016-05-23 13:46:48 -07:00
Olaoluwa Osuntokun 18314f73ae lnwire: document and update SingleFundingResponse 2016-05-23 13:46:26 -07:00
Olaoluwa Osuntokun 3bf2d62035 lnwire: document start of single funder workflow
This commit adds some additional documentation in the form of comments
to the start of the revised single funder workflow.

A primary change lies in the introduction of the exchange of Channel
Derivation Points (CDP’s) for both sides. Using CDP’s we can derive
channel authentication proofs which are both unforgettable and binding.
2016-05-23 13:40:45 -07:00
Olaoluwa Osuntokun f799ff3b66 lnwire: add SingleFundingSignComplete msg to workflow
This commit adds the SingleFundingSignComplete message to the single
funder transaction workflow. This marks the second to last message sent
in the workflow. The message transports Bob’s signature for the
commitment transaction, allowing Alice to broadcast the funding
transaction as she can now refund her inputs.
2016-05-22 22:29:52 -07:00
Olaoluwa Osuntokun 59a65518c1 lnwire: add SingleFundingComplete to single funder
This commit adds the SingleFundingComplete message to the single funder
channel workflow. This is the 3rd message sent in the workflow,
traveling from Alice to Bob once Alice is able to construct the final
commitment transaction.
2016-05-22 22:25:52 -07:00
Olaoluwa Osuntokun 6eaf4908fb uspv: update to new upstream btcd api to fix compile errors 2016-05-22 22:04:25 -07:00
Olaoluwa Osuntokun fcff17c336 multi: change all imports to roasbeef's forks
This commit will allow the general public to build lnd without jumping
through hoops setting up their local git branches nicely with all of
our forks.
2016-05-15 17:22:37 +03:00
Olaoluwa Osuntokun f78283a438 chainnfts/btcdnotify: update test to upstream API change.
rpctest.Harness.CoinbaseSpend now takes a list of outputs rather, than
a map from address to output amount.
2016-05-03 20:47:24 -07:00
Olaoluwa Osuntokun d09f858501 sighash143: remove directory
This directory is no longer needed as segwit has been fully implemented
in my fork of btcd: github.com/roasbeef/btcd.
2016-05-03 20:46:00 -07:00
Olaoluwa Osuntokun c6eedafb9a lnwallet: update reservation workflow to be segwitty
Only nested p2sh or pure witness outputs are used when selecting coins
for inputs to a funding transaction.

The funding transaction output now uses p2wsh rather than regular p2sh.

All tests have been updated accordingly.
2016-05-03 20:06:58 -07:00
Olaoluwa Osuntokun 4b4c0f73b0 lnwallet: add ListUnspentWitness for funding tx coin selection 2016-05-03 20:06:49 -07:00
Olaoluwa Osuntokun 0e74672797 lnwallet: use InputScripts struct within ChannelReservation
This allows the reservation workflow to support pure witness program
outputs, as well as witness programs nested within p2sh.
2016-05-03 20:06:44 -07:00
Olaoluwa Osuntokun eeb2887fe9 lnwallet: segwit-ify all scripts and signing utils 2016-05-03 20:06:39 -07:00
Olaoluwa Osuntokun 163eb8dcb8 lnwallet: remove FundingType enum
Removing as segwit is now the path forward.
2016-05-03 20:06:30 -07:00
Olaoluwa Osuntokun 20f5ff56eb channeldb: fix imports 2016-05-03 20:02:46 -07:00
Olaoluwa Osuntokun 1a96e4f7a6 lnwallet: default to p2wkh address for generated change+delivery addresses 2016-04-24 20:27:56 -07:00
Olaoluwa Osuntokun 35bbf53e59 cmd/lncli: command line parsing for address types for 'newaddress' 2016-04-24 20:27:19 -07:00
Olaoluwa Osuntokun bba8770bb4 lnrpc: add address type param to NewAddress
The new available address types are: regular p2pkh, p2wkh, and finally
p2wkh nested within p2sh. The latter address type will initially be
used to allow users to “fund” the lnd wallet.
2016-04-24 20:26:32 -07:00
Olaoluwa Osuntokun 9982bf4c33 use lnwallet's Shutdown method instead of btcwallet's inner Stop 2016-04-24 12:40:40 -07:00
Olaoluwa Osuntokun 1dfe344c4d p2p listener should only log an error if not shutting down 2016-04-24 12:40:23 -07:00
Olaoluwa Osuntokun 0e607c1939 lnwallet: during shutdown properly wait for all goroutines to exit 2016-04-24 12:39:43 -07:00
Olaoluwa Osuntokun 2b047ff56c lnrpc: update golang proto compiler
The newest version has changed the generated gRPC source files a bit.
If you’re running the _newset_ version of gRPC against the previously
generated code, you’ll get a compile error.

This commit fixes the above behavior.
2016-04-24 12:38:47 -07:00
Olaoluwa Osuntokun fc06c7bffb lndc: use constant time comparison to verify DH proof 2016-04-24 12:37:27 -07:00
Olaoluwa Osuntokun ea49b15e70 pass in net params during channeldb initialization 2016-04-24 12:37:09 -07:00
Olaoluwa Osuntokun 3e3c028313 default net params to segnet4 2016-04-24 12:36:45 -07:00
Olaoluwa Osuntokun fa1e7a332f channeldb: remove hardcoded netparams 2016-04-24 12:35:52 -07:00
Olaoluwa Osuntokun 1e35018e89 lnwallet: fix compile errors against btcd's segwit branch 2016-04-12 21:37:08 -07:00
Olaoluwa Osuntokun f9a8dcbc9c lnwallet: add ListUnspentWitness to WalletController
This method has been added in order to allow lnd to collect eligible
unspent witness programs outputs from the wallet controller for use as
inputs to the funding transaction.

Additionally, the change address functions now also specify whether the
generated change address should be payable to a witness program or not.
2016-04-12 21:36:41 -07:00
Olaoluwa Osuntokun 10d52611cd lnwallet: introduce WalletController interface as a "base wallet"
The WalletController will serve as a layer of separation between “base”
Bitcoin wallet logic, and the higher level Lightning Network logic. As
a result LightningWallet will no behave as an overly wallet, relying on
the lower wallet for basic services such as new address, signing etc.

Within this higher level lies the awareness of channel types, chain
monitoring, HTLCs, and so on.
2016-03-24 16:19:57 -07:00
Olaoluwa Osuntokun 8ca9d6d22f lndc: update tests due to interface change 2016-03-24 14:41:17 -07:00
Olaoluwa Osuntokun d160a87b2a register waddrmgr as the default EncryptorDecryptor on startup 2016-03-24 14:32:55 -07:00
Olaoluwa Osuntokun 7420503c7a lnwallet: publicly export WaddrmgrEncryptorDecryptor 2016-03-24 14:32:44 -07:00
Olaoluwa Osuntokun 3f5664b46d channeldb: unify Create/Open into simply Open
Open will now create, and initialize the db if it does not yet exist.
2016-03-24 14:31:46 -07:00