Commit Graph

41 Commits

Author SHA1 Message Date
Olaoluwa Osuntokun
98bbd314a7 lnwallet: add active Bitcoin network to config 2016-02-03 12:01:44 -08:00
Olaoluwa Osuntokun
80ce49a883 lnwallet: update btcwallet and chain.Client to new upstream API's
A major change for btcwallet adding a new RPC wallet, refactoring parts
of the wallet, and introducing new functionality has been introduced.
This commit updates lnwallet to the API changes. A future commit will
change lnwallet to use some of the new functionality such as the
notification server, etc.
2016-02-03 12:01:44 -08:00
Olaoluwa Osuntokun
034cbef66d lnwallet: avoid goroutines waiting for channel open indefinitely blocking
Select over the quit channel in order to shutdown goroutines waiting
for funding txn confirmations. Without this we may leak goroutines
which are blocked forever if the process isn’t exiting when the walet
is signaled to shutdown.
2016-02-03 12:01:44 -08:00
Olaoluwa Osuntokun
20d471a766 lnwalelt: add note for balance update ntfs 2016-02-03 12:01:44 -08:00
Tadge Dryja
2815afebb7 update imports to github 2016-01-16 10:45:54 -08:00
Olaoluwa Osuntokun
07b0d5ca3e lnwallet: once the reservation workflow is complete, wait then open the payment channel
* Hooks into the ChainNotifier infrastructure to receive a notification
once the funding transaction gets enough notifications.
* Still need to set up the notification grouting within a
LightningChannel to watch for uncooperative closures, and broadcasts
and revoked channel states.
2016-01-14 23:58:04 -08:00
Olaoluwa Osuntokun
6e0cfaf7ec lnwallet: re-introduce rpc calls during channel reservation workflow
* In preparation for regression testing once nodetest is finished.
* These sections we’re previously uncommented to allow for testing the
wallet without a full-node hooked up.
2016-01-14 23:58:04 -08:00
Olaoluwa Osuntokun
cf65aaa2c9 lnwallet: have wallet return db so it can be closed during shutdown
* Also remove some extra print statements from debugging
* Separate out logic to create wallet from creating an ID
2016-01-14 23:57:54 -08:00
Tadge Dryja
19233dc42d wallet creation works, takes 11 seconds 2016-01-14 23:56:09 -08:00
Olaoluwa Osuntokun
1772108544 lnwallet: start of HTLC update logic
* moved sorting of transaction outside of createCommitTx also us to add
HTLC’s before sorting
* On the fence about the proxy object design, will re-visit once we
start to implement the p2p code.
2016-01-14 23:56:09 -08:00
Olaoluwa Osuntokun
c41f7d1a7d lnwallet: update to 20 byte revocation hashes 2016-01-14 23:56:08 -08:00
Tadge Dryja
cb32ab1fb9 identify where it freezes. in btcwallet/walletdb/interface.go:271 2016-01-14 23:56:08 -08:00
Tadge Dryja
8504362c5e trying to store id pkh. Doesn't work; wallet creation never completes 2016-01-14 23:56:08 -08:00
Tadge Dryja
e70c6aa367 trying to store private identity key. Doesn't work. 2016-01-14 23:56:08 -08:00
Olaoluwa Osuntokun
a5f0d3e56e lnwallet: require TLS for rpc client 2015-12-29 21:52:20 -06:00
Olaoluwa Osuntokun
ace1aca43c lnwallet: actually connect the rpc client... 2015-12-29 21:08:56 -06:00
Olaoluwa Osuntokun
b3e821c4d2 lnwallet: make KeyGenMtx public, roc server needs to synchronize 2015-12-29 17:09:32 -06:00
Olaoluwa Osuntokun
7640e57cdc lnwallet: add dirty config 2015-12-29 15:59:57 -06:00
Olaoluwa Osuntokun
f1717b9620 lnwallet: embed btwallet within LightningWallet, exposes all methods publicly
* As a result in order to not over-shadow the Start/Stop methods of
btcwallet.Wallet, the Start/Stop methods on LightningWallet have been
renamed to Startup/Shutdown.
2015-12-29 12:45:31 -06:00
Olaoluwa Osuntokun
6eb77b02c2 lnwallet: add comments to wallet.go 2015-12-29 00:00:29 -06:00
Olaoluwa Osuntokun
8ca8eb60fb lnwallet: verify received commitment tx signature is valid 2015-12-29 00:00:29 -06:00
Olaoluwa Osuntokun
695a1e6c45 lnwallet: sign the REDEEMSCRIPT not the p2sh script :) 2015-12-29 00:00:28 -06:00
Olaoluwa Osuntokun
17f37cc254 lnwallet: shutdown rpc connection during stoppage 2015-12-29 00:00:28 -06:00
Olaoluwa Osuntokun
36e7c38812 lnwallet: introduce mutex around coin selection logic 2015-12-29 00:00:28 -06:00
Olaoluwa Osuntokun
7874357384 lnwallet: remove unused struct 2015-12-29 00:00:28 -06:00
Olaoluwa Osuntokun
4fdb2763e6 channeldb: create new channeldb package, update lnwallet to use new API
* Initial draft of brain dump of chandler. Nothing yet set in stone.
* Will most likely move the storage of all structs to a more “column”
oriented approach. Such that, small updates like incrementing the total
satoshi sent don’t result in the entire struct being serialized and
written.
* Some skeleton structs for other possible data we might want to store
are also included.
* Seem valuable to record as much data as possible for record keeping,
visualization, debugging, etc. Will need to set up a time+space+dirty
cache to ensure performance isn’t impacted too much.
2015-12-26 12:35:15 -06:00
Olaoluwa Osuntokun
b4e33587b1 lnwallet: switch to using channeldb 2015-12-26 00:05:55 -06:00
Olaoluwa Osuntokun
ff92efe7df lnwallet: add node's ID to reservation workflow 2015-12-26 00:05:07 -06:00
Olaoluwa Osuntokun
4bb526854a lnwallet: fix bug don't set TheirCommitSig twice 2015-12-26 00:03:53 -06:00
Olaoluwa Osuntokun
5840786922 lnwallet: save redeemScript in channel state 2015-12-24 12:42:29 -06:00
Olaoluwa Osuntokun
15f15bb3af rename revocation package to shachain
* Constructors now also more in line with “Effective Go”
2015-12-24 12:42:03 -06:00
Olaoluwa Osuntokun
07646d05db move channel state struct to channeldb.go
* All fields are now publicly exported
2015-12-24 12:41:15 -06:00
Olaoluwa Osuntokun
d24831dc29 lnwallet: update workflow around contributions 2015-12-22 22:31:17 -06:00
Olaoluwa Osuntokun
829f67f33e lnwallet: CompleteReservation now includes sig for commit tx 2015-12-21 15:54:33 -06:00
Olaoluwa Osuntokun
584fc9b620 lnwallet: AddFunds is now AddContribution, accounts for commitment tx
* Contribution from remote host necessary to construct the initial
commitment transaction is now also expected
* All message structs and handlers updated accordingly
* AddContribution now also generates both commitment tnxs, and
generates a signature for their version of the commitment transaction
2015-12-21 15:53:34 -06:00
Olaoluwa Osuntokun
34e35fe2d5 lnwallet: set commit tnx related info in ChannelReservation
* Future commit will ditch all the thread-safe “getter” like methods.
We’re all adults just make sure to grab the lock.
* All wallet mutation funcs will also document which fields are set
after completion of the request
* Set shaChain, delivery address, commitment key
2015-12-20 17:13:14 -06:00
Olaoluwa Osuntokun
c7d604fd0b lnwallet: use funcs in script_utils.go 2015-12-20 17:11:21 -06:00
Olaoluwa Osuntokun
d2e3b376ea lnwallet: re-name package to lnwallet, though it was? 2015-12-20 00:00:50 -06:00
Olaoluwa Osuntokun
420e34cc91 lnwallet: forgot some field name changes 2015-12-18 21:43:37 -06:00
Olaoluwa Osuntokun
2f7a801dcb lnwallet: embed channel state within ChannelReservation 2015-12-18 21:39:51 -06:00
Olaoluwa Osuntokun
147748d178 rename wallet to lnwallet 2015-12-16 14:51:59 -06:00