Skip to content

Commit 5cea874

Browse files
committed
chainntnfs: export NotifierOptions and internal field for interface use
Export NotifierOptions and its internal field to enable external satisfaction of the protofsm.DaemonAdapters interface.
1 parent b5c84ea commit 5cea874

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

chainntnfs/interface.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -70,28 +70,28 @@ func (t TxConfStatus) String() string {
7070
}
7171
}
7272

73-
// notifierOptions is a set of functional options that allow callers to further
73+
// NotifierOptions is a set of functional options that allow callers to further
7474
// modify the type of chain event notifications they receive.
75-
type notifierOptions struct {
76-
// includeBlock if true, then the dispatched confirmation notification
75+
type NotifierOptions struct {
76+
// IncludeBlock if true, then the dispatched confirmation notification
7777
// will include the block that mined the transaction.
78-
includeBlock bool
78+
IncludeBlock bool
7979
}
8080

81-
// defaultNotifierOptions returns the set of default options for the notifier.
82-
func defaultNotifierOptions() *notifierOptions {
83-
return &notifierOptions{}
81+
// DefaultNotifierOptions returns the set of default options for the notifier.
82+
func DefaultNotifierOptions() *NotifierOptions {
83+
return &NotifierOptions{}
8484
}
8585

8686
// NotifierOption is a functional option that allows a caller to modify the
8787
// events received from the notifier.
88-
type NotifierOption func(*notifierOptions)
88+
type NotifierOption func(*NotifierOptions)
8989

90-
// WithIncludeBlock is an optional argument that allows the calelr to specify
90+
// WithIncludeBlock is an optional argument that allows the caller to specify
9191
// that the block that mined a transaction should be included in the response.
9292
func WithIncludeBlock() NotifierOption {
93-
return func(o *notifierOptions) {
94-
o.includeBlock = true
93+
return func(o *NotifierOptions) {
94+
o.IncludeBlock = true
9595
}
9696
}
9797

chainntnfs/txnotifier.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ func NewTxNotifier(startHeight uint32, reorgSafetyLimit uint32,
559559
// and register a confirmation notification.
560560
func (n *TxNotifier) newConfNtfn(txid *chainhash.Hash,
561561
pkScript []byte, numConfs, heightHint uint32,
562-
opts *notifierOptions) (*ConfNtfn, error) {
562+
opts *NotifierOptions) (*ConfNtfn, error) {
563563

564564
// An accompanying output script must always be provided.
565565
if len(pkScript) == 0 {
@@ -593,7 +593,7 @@ func (n *TxNotifier) newConfNtfn(txid *chainhash.Hash,
593593
n.CancelConf(confRequest, confID)
594594
}),
595595
HeightHint: heightHint,
596-
includeBlock: opts.includeBlock,
596+
includeBlock: opts.IncludeBlock,
597597
numConfsLeft: numConfs,
598598
}, nil
599599
}
@@ -616,7 +616,7 @@ func (n *TxNotifier) RegisterConf(txid *chainhash.Hash, pkScript []byte,
616616
default:
617617
}
618618

619-
opts := defaultNotifierOptions()
619+
opts := DefaultNotifierOptions()
620620
for _, optFunc := range optFuncs {
621621
optFunc(opts)
622622
}

0 commit comments

Comments
 (0)