From 1879c00c55f510e94b0f926cfa53e96a1cf111a5 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Mon, 20 Jun 2016 21:27:38 -0700 Subject: [PATCH] chainntfs: further specify behavior of RegisterSpendNtfn MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit updates the documentation for the chainntfs interface to specify that notifications for spends registered with `RegisterSpendNtfn` should be triggered *only* once a transaction spending the target outpoint is *seen* within the network. This strictness is required in order to allow an ‘honest’ counter-party to properly sweep funds within channels with short delays. --- chainntfs/chainntfs.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/chainntfs/chainntfs.go b/chainntfs/chainntfs.go index 5b9380f47..2effd001e 100644 --- a/chainntfs/chainntfs.go +++ b/chainntfs/chainntfs.go @@ -22,6 +22,9 @@ type ChainNotifier interface { // outpoint is succesfully spent within a confirmed transaction. The // returned SpendEvent will receive a send on the 'Spend' transaction // once a transaction spending the input is detected on the blockchain. + // + // NOTE: This notifications should be triggered once the transaction is + // *seen* on the network, not when it has received a single confirmation. RegisterSpendNtfn(outpoint *wire.OutPoint) (*SpendEvent, error) // Start the ChainNotifier. Once started, the implementation should be