From 9d51114546bf7efeabbeb0e97fa80a79ea5f78e6 Mon Sep 17 00:00:00 2001 From: Wilmer Paulino Date: Tue, 4 Dec 2018 16:57:37 -0800 Subject: [PATCH] chainntnfs/txnotifier: define ReorgSafetyLimit as 144 blocks --- chainntnfs/txnotifier.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/chainntnfs/txnotifier.go b/chainntnfs/txnotifier.go index e3f3c4e1..84bd55e1 100644 --- a/chainntnfs/txnotifier.go +++ b/chainntnfs/txnotifier.go @@ -10,6 +10,15 @@ import ( "github.com/btcsuite/btcutil" ) +const ( + // ReorgSafetyLimit is the chain depth beyond which it is assumed a + // block will not be reorganized out of the chain. This is used to + // determine when to prune old confirmation requests so that reorgs are + // handled correctly. The average number of blocks in a day is a + // reasonable value to use. + ReorgSafetyLimit = 144 +) + var ( // ErrTxNotifierExiting is an error returned when attempting to interact // with the TxNotifier but it been shut down.