From 702f214972f74a3e6f4b7e13968910fa91e5883c Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Sat, 24 Dec 2016 18:44:10 -0600 Subject: [PATCH] utxonursery: update inner loop to use new ChainNotifier API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Within the inner loop of the utxoNursery when waiting for a new sweepable transaction to be confirmed, we now use the new ChainNotifier API for ConfirmationEvent’s which exposes additional details as to exactly where in the chain the transaction was ultimately confirmed. --- utxonursery.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/utxonursery.go b/utxonursery.go index f09ecba2..f92bf417 100644 --- a/utxonursery.go +++ b/utxonursery.go @@ -137,17 +137,18 @@ out: // the output back to the incubator once the // source txn has been confirmed. go func() { - confHeight, ok := <-confChan.Confirmed + confDetails, ok := <-confChan.Confirmed if !ok { utxnLog.Errorf("notification chan "+ "closed, can't advance output %v", outpoint) return } + confHeight := uint32(confDetails.BlockHeight) utxnLog.Infof("Outpoint %v confirmed in "+ "block %v moving to mid-stage", outpoint, confHeight) - immatureUtxo.confHeight = uint32(confHeight) + immatureUtxo.confHeight = confHeight midStageOutputs <- immatureUtxo }() }