Commit Graph

15 Commits

Author SHA1 Message Date
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
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
9b9f792f10 chainntfns: document the BtcdNotifier implementation of ChainNotifier 2016-02-26 17:38:31 -08:00
Olaoluwa Osuntokun
77d37298f4 chainntfns: close all pending client channels on shutdown for BtcdNotifier 2016-02-26 17:38:31 -08:00
Olaoluwa Osuntokun
8ce8c29af6 chainntfns: add basic tests for confirmation+spending notifications
* The tests as written will be general to all future implementations of
ChainNotifier allowing future implementers to easily ensure their
implementation meets the expected behavior.

* The tests will be moved to the outer directory once a registration
mechanism for notifier implementations is in place.
2016-02-26 17:38:31 -08:00
Olaoluwa Osuntokun
e92fc5f495 chainntfs: switch BtcdNotifier to directly use btcrpcclient
* Turns out the NotificationServer on btcwallet doesn’t sever full
blocks, nor notify for arbitrary transactions. Instead, we now create a
new client specifically for BtcdNotifier.

* Final implementation is simpler, less dependent on newer btcwallet
features in flux. Additionally, this decouples the chain notifications
from the wallet. Enabling reliance on btcd for notifications, in
conjunction with an independent wallet that satisfies the to-be-drafted
Wallet interface.
2016-02-26 17:38:31 -08:00
Olaoluwa Osuntokun
1c59dfc75c chainntfs: fix the Pop method on confirmationHeap 2016-02-26 17:38:31 -08:00
Olaoluwa Osuntokun
3d478cdd3e chainntfs: use btcwallet's new NotificationServer for BtcdNotifier
* Rather than rely on the legacy notification interface which may be
deprecated in the near future, we’ll now switch to using the
NotificationSever.

* Negative confirmation notifications due to re-orgs are still
unimplemented however.
2016-02-26 17:38:30 -08:00
Olaoluwa Osuntokun
9fb8045bd2 chainntfns: remove source.go it's no longer needed 2016-02-26 17:38:30 -08:00
Olaoluwa Osuntokun
c7402f3462 chainntfns: update BtcdNotifier to adhere to new ChainNotifier interface
* Re-orgs are still unhanded.

* RegisterSpendNtfn should perhaps also register directly with the rpc
client instead of pushing the responsibility to the caller.
2016-02-26 17:38:30 -08:00
Tadge Dryja
2815afebb7 update imports to github 2016-01-16 10:45:54 -08:00
Olaoluwa Osuntokun
5f705be63b chainntfs: introduce ChainConnection interface to avoid import cycle and for future tests
* Looks rather hack atm. Put in place so progress can be had with
lnwallet before notes is finished.
2016-01-14 23:58:04 -08:00
Olaoluwa Osuntokun
986eb83ceb chainntfs: create new ChainNotifier for bfcd-based notifications
* Currently depends on the wallet, but that will change in the near
future due to new additions to btcwallet currently under review.
* Re-orgs aren’t intelligently handled yet. To be done along with tests
in a later commit.
2016-01-14 23:56:11 -08:00