Commit Graph

574 Commits

Author SHA1 Message Date
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
Riccardo Casatta
46bd85d21e Updating Readme with reference to Segnet4 instead of testnet-L 2016-05-10 18:32:11 +02: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
Tadge Dryja
71231c477c make imports lowercase 2016-04-30 20:24:57 -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
Joseph Poon
5218dca5b6 Simplified the commitment messages 2016-04-11 00:55:48 -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
Olaoluwa Osuntokun
082a8a34e3 lnwallet: update tests and workflow to new OpenChannel struct 2016-03-24 00:01:35 -07:00
Olaoluwa Osuntokun
983294c444 lnwallet: set OpenChannel's internal db pointer 2016-03-24 00:01:17 -07:00
Olaoluwa Osuntokun
4b16763f4d lnwallet: update channel.go to new OpenChannel fields
Simply to compile, channel.go will be replaced with lnstate soon
enough.
2016-03-24 00:00:59 -07:00
Olaoluwa Osuntokun
afb45ffe8b channeldb: temporary hack...
Need to add a channeldb.NewOpenChannel() method to once again allow a
channel’s db pointer to be private.
2016-03-24 00:00:22 -07:00
Olaoluwa Osuntokun
87603e780f channeldb: re-design OpenChannel schema, update tests
The state of OpenChannel on disk has now been partitioned into several
buckets+keys within the db. At the top level, a set of prefixed keys
stored common data updated frequently (with every channel update).
These fields are stored at the top level in order to facilities prefix
scans, and to avoid read/write amplification due to
serialization/deserialization with each read/write.

Within the active channel bucket, a nested bucket keyed on the node’s
ID stores the remainder of the channel.

Additionally OpenChannel now uses elkrem rather than shachain, delivery
scripts instead of addresses, stores the total net fees, and splits the
csv delay into the remote vs local node’s.

Several TODO’s have been left lingering, to be visited in the near
future.
2016-03-23 22:39:52 -07:00
Olaoluwa Osuntokun
631e76519e channeldb: switch to Open/Create methods rather than New
Commit includes basic tests for Open/Create. Additionally, rather than
relying on btcwallet’s addmgr for encryption/decryption, this package
now exposes a simple crypto system interface.
2016-03-23 22:11:57 -07:00
Olaoluwa Osuntokun
3faa2c2ef5 parse config, set up interrupt handler during lnd's main execution 2016-03-22 18:50:11 -07:00
Olaoluwa Osuntokun
555003006b add WaitForShutdown method to the server, additional logging 2016-03-22 18:49:22 -07:00
Olaoluwa Osuntokun
d9922dc76d update the rpcserver's SendMany method to new btcwallet API 2016-03-22 18:48:46 -07:00
Olaoluwa Osuntokun
fe6d71e95e lnwallet: accept channeldb as a param in constructor
lnwallet is no longer responsible for creating/opening channeldb. The
call is now expected to do so.
2016-03-22 18:48:18 -07:00
Olaoluwa Osuntokun
27fee0e7d3 lndc: fix bug, return error instead of nil on accept error 2016-03-22 18:47:26 -07:00
Olaoluwa Osuntokun
78c6053ba6 cmd/lncli: default RPC port is now 10009 2016-03-22 18:47:10 -07:00
Olaoluwa Osuntokun
6155fd5d01 channeldb: move node ID/addr funds to node.go 2016-03-22 18:46:54 -07:00
Olaoluwa Osuntokun
3e3948a04f channeldb: switch to bolt.DB instead of walletdb.DB
This decouples channeldb from btcwallet, and also allows us access to
bolt’s Batch() call.
2016-03-22 18:46:30 -07:00
Olaoluwa Osuntokun
670d441dea finalize initial draft of config.go
lnd now supports parsing configuration via the command line, and its
dedicated AppDataDir
2016-03-22 18:44:17 -07:00
Olaoluwa Osuntokun
8feb86c4aa multi: create lnd's logging infrastructure 2016-03-22 18:43:10 -07:00
Olaoluwa Osuntokun
d70a39254c create signal.go to handle SIGINT's 2016-03-22 18:42:01 -07:00
Olaoluwa Osuntokun
a21ad6e888 create version.go file
A file dedicated to handling+dispatching version information concerning
lnd. We’ll be using the semantic versioning standard.

I guess lnd is officially at 0.1.0-alpha now?
2016-03-22 18:40:54 -07:00
Olaoluwa Osuntokun
90063e1431 run go fmt on config file 2016-03-22 13:30:54 -07:00
mkl
e07086a523 Integrate basic configuration functionality 2016-03-22 13:28:56 -07:00