chainntnfs: add unique ID field to track conf ntfns within notifier

This commit is contained in:
Wilmer Paulino committed 2018-07-31 18:23:25 -07:00
1 parent ad904ebe8c
commit c43506dee9
4 files changed
+15 -5

No files matched your search

+2
View File
@@ -61,6 +61,7 @@ type txUpdate struct {
// notifications. Multiple concurrent clients are supported. All notifications
// are achieved via non-blocking sends on client channels.
type BtcdNotifier struct {
confClientCounter uint64 // To be used aotmically.
spendClientCounter uint64 // To be used atomically.
epochClientCounter uint64 // To be used atomically.
@@ -800,6 +801,7 @@ func (b *BtcdNotifier) RegisterConfirmationsNtfn(txid *chainhash.Hash,
ntfn := &confirmationNotification{
ConfNtfn: chainntnfs.ConfNtfn{
ConfID: atomic.AddUint64(&b.confClientCounter, 1),
TxID: txid,
NumConfirmations: numConfs,
Event: chainntnfs.NewConfirmationEvent(numConfs),