// OnFilteredBlockConnectedHandleFunc is invoked when a block is connected to the
// longest (best) chain.  It will only be invoked if a preceding call to
// NotifyBlocks has been made to register for the notification and the
// function is non-nil.  Its parameters differ from OnBlockConnected: it
// receives the block's height, header, and relevant transactions.
OnFilteredBlockConnectedHandleFunc is invoked when a block is connected to the
longest (best) chain.  It will only be invoked if a preceding call to
NotifyBlocks has been made to register for the notification and the
function is non-nil.  Its parameters differ from OnBlockConnected: it
receives the block's height, header, and relevant transactions.
// OnFilteredBlockConnectedHandleFunc is invoked when a block is connected to the // longest ( best ) chain . It will only be invoked if a preceding call to // NotifyBlocks has been made to register for the notification and the // function is non - nil . Its parameters differ from OnBlockConnected : it // receives the block ' s height header and relevant transactions .
func OnFilteredBlockConnectedHandleFunc() func(height int32, header *wire.BlockHeader, txns []*btcutil.Tx) {
	return func(height int32, header *wire.BlockHeader, txns []*btcutil.Tx) {
		connectTime := time.Now()
		succ := make(chan struct{})
		var b *wire.MsgBlock
		hash := header.BlockHash()
		go func(hash chainhash.Hash) {
			res := rpcClient.GetBlockAsync(&hash)
			_b, err := res.Receive()
			if err != nil {
				_logger.Fatal(err)
			}
			b = _b
			succ <- struct{}{}
		}(hash)
		go func() {
			for range succ {
				xb := types.NewBlock(b, connectTime)
				_logger.Infof("<OnFilteredBlockConnected blockHeight=%d block=%s/>", height, xb.String())
			}
		}()
	}
}
func OnFilteredBlockConnectedHandleFunc ( ) func ( height int32 , header * wire . BlockHeader , txns [ ] * btcutil . Tx ) { return func ( height int32 , header * wire . BlockHeader , txns [ ] * btcutil . Tx ) { connectTime := time . Now ( ) succ := make ( chan struct { } ) var b * wire . MsgBlock hash := header . BlockHash ( ) go func ( hash chainhash . Hash ) { res := rpcClient . GetBlockAsync ( & hash ) _b , err := res . Receive ( ) if err != nil { _logger . Fatal ( err ) } b = _b succ <- struct { } { } } ( hash ) go func ( ) { for range succ { xb := types . NewBlock ( b , connectTime ) _logger . Infof ( " " , height , xb . String ( ) ) } } ( ) } }
OnFilteredBlockConnectedHandleFunc is invoked when a block is connected to the
longest (best) chain.
OnFilteredBlockConnectedHandleFunc is invoked when a block is connected to the longest ( best ) chain .