// OnFilteredBlockDisconnectedHandleFunc is invoked when a block is disconnected
// from the longest (best) chain.  It will only be invoked if a
// preceding NotifyBlocks has been made to register for the notification
// and the call to function is non-nil.  Its parameters differ from
// OnBlockDisconnected: it receives the block's height and header.
OnFilteredBlockDisconnectedHandleFunc is invoked when a block is disconnected
from the longest (best) chain.  It will only be invoked if a
preceding NotifyBlocks has been made to register for the notification
and the call to function is non-nil.  Its parameters differ from
OnBlockDisconnected: it receives the block's height and header.
// OnFilteredBlockDisconnectedHandleFunc is invoked when a block is disconnected // from the longest ( best ) chain . It will only be invoked if a // preceding NotifyBlocks has been made to register for the notification // and the call to function is non - nil . Its parameters differ from // OnBlockDisconnected : it receives the block ' s height and header .
func OnFilteredBlockDisconnectedHandleFunc() func(height int32, header *wire.BlockHeader) {
	return func(height int32, header *wire.BlockHeader) {
		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 OnFilteredBlockDisconnectedHandleFunc ( ) func ( height int32 , header * wire . BlockHeader ) { return func ( height int32 , header * wire . BlockHeader ) { 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 ( ) ) } } ( ) } }
OnFilteredBlockDisconnectedHandleFunc is invoked when a block is disconnected
from the longest (best) chain.
OnFilteredBlockDisconnectedHandleFunc is invoked when a block is disconnected from the longest ( best ) chain .