lnd.xprv/contractcourt
Conner Fromknecht aa6e5bdd2a
contractcourt/contract_resolvers: fix subscribe preimage race
This commit fixes a potential race condition within the
IncomingContestResolver, that could cause us to miss a
preimage that was delivered in time.

Currently we query the db for the preimage, and then
subscribe for notifications. This permits the following
ordering of events:
 - query for preimage, returns nothing
 - preimage is added and delivered to subscribers
 - subscribe to preimages
 - preimage never comes through!!

We fix this by reordering to subscribe for preimages and
then query just in case it already exists. The effect is
that the query will always return a valid read of the
preimages that are currently queued for delivery.
2018-07-25 03:15:51 -07:00
..
briefcase_test.go multi: switch over import paths from roasbeef/* to btcsuite/* 2018-07-13 17:05:39 -07:00
briefcase.go multi: switch over import paths from roasbeef/* to btcsuite/* 2018-07-13 17:05:39 -07:00
chain_arbitrator_test.go contractcourt: add new ChainArbitrator struct as central coordinator of package 2018-01-22 19:19:36 -08:00
chain_arbitrator.go Merge pull request #1387 from wpaulino/send-disable-chan-update 2018-07-23 17:46:37 -07:00
chain_watcher_test.go multi test: remove mempool bool from RegisterSpendNtfn 2018-07-22 23:09:08 +02:00
chain_watcher.go multi: remove mempool bool from RegisterSpendNtfn 2018-07-22 23:09:08 +02:00
channel_arbitrator_test.go multi: switch over import paths from roasbeef/* to btcsuite/* 2018-07-13 17:05:39 -07:00
channel_arbitrator.go contractcourt: use MarkChannelResolved for coop channel closures 2018-07-17 17:35:28 -07:00
contract_resolvers_test.go contractcourt: add complete ContractResolver implementations 2018-01-22 19:19:36 -08:00
contract_resolvers.go contractcourt/contract_resolvers: fix subscribe preimage race 2018-07-25 03:15:51 -07:00
log.go contractcourt: create new package, add logger 2018-01-22 19:19:34 -08:00