Commit Graph

6 Commits

Author SHA1 Message Date
Olaoluwa Osuntokun
3186b3038c chainntfns: document the ChainNotifier interface 2016-02-26 17:38:31 -08:00
Olaoluwa Osuntokun
19e1b64f2c chainntfs: use an int32 for NegativeConf 2016-02-26 17:38:31 -08:00
Olaoluwa Osuntokun
b913bda472 chainntfs: expand ChainNotifier interface
* The `NotificationTrigger` struct has been dropped. Instead we know
simply employ a non-blocking send over a chan struct. This moves the
responsibility of triggering callbacks a level above to the registering
client.

* Confirmation notifications also now have a counter part in order to
notify a caller of the scenario wherein a funding transaction drops out
of the chain due to a re-org. A “neagtiveConf” value will be sent to
the client over a channel in this case. This will allow a caller to
re-register for another confirmation notification. Note that due to
this scenario, callers should also register for notifications
concerning spends of the counterparty’s inputs to the funding
transaction. If a second spend (other than the funding) is detected,
the channel should be closed immediately.

* Notifications concerning spends now also include the spending
transaction, hash, and the input on the spending transaction at which
the outpoint is spent.
2016-02-26 17:38:30 -08:00
Olaoluwa Osuntokun
8154b96d67 chainntfs: flesh out initial draft of interface
* So far very simple, only notifications for tx confirmations, and
outpoint spends.
* Our two cases are: waiting for the funding transaction to reach a
depth of N confirmations, and open channels being notified of the
counterpart trying to cheat them by broadcasting an invalidated
commitment tx.
2016-01-14 23:56:11 -08:00
Olaoluwa Osuntokun
e2c4ccbe28 chaintfns: skeleton of first notifier 2015-12-16 22:55:22 -06:00
Olaoluwa Osuntokun
b2522ef75a Create skeleton for chain notifications
* Goal is to backend agnostic source to chain notifications
* Open channels will communicate with this source to register intent
for critical notifications
* Pending notifications will need to be committed to disk.
* Will also need a journal to ensure no notification is missed
* Later goals include extending this to communicate with 3rd party
outsource services
2015-12-16 14:38:21 -06:00