func (c *BitcoindClient) IsCurrent() bool {
	bestHash, _, err := c.GetBestBlock()
	if err != nil {
		return false
	}
	bestHeader, err := c.GetBlockHeader(bestHash)
	if err != nil {
		return false
	}
	return bestHeader.Timestamp.After(time.Now().Add(-isCurrentDelta))
}
IsCurrent returns whether the chain backend considers its view of the network
as "current".
package chain
import (
	"container/list"
	"encoding/hex"
	"errors"
	"fmt"
	"sync"
	"sync/atomic"
	"time"
	"github.com/gcash/bchd/btcjson"
	"github.com/gcash/bchd/chaincfg"
	"github.com/gcash/bchd/chaincfg/chainhash"
	"github.com/gcash/bchd/txscript"
	"github.com/gcash/bchd/wire"
	"github.com/gcash/bchutil"
	"github.com/gcash/bchwallet/waddrmgr"
	"github.com/gcash/bchwallet/wtxmgr"
)
var (
	ErrBitcoindClientShuttingDown = errors.New("client is shutting down")
)
type BitcoindClient struct {
	notifyBlocks uint32
	started int32  
	stopped int32  
	birthday time.Time
	chainParams *chaincfg.Params
	id uint64
	chainConn *BitcoindConn
	bestBlockMtx sync.RWMutex
	bestBlock    waddrmgr.BlockStamp
	rescanUpdate chan interface{}
	watchMtx         sync.RWMutex
	watchedAddresses map[string]struct{}
	watchedOutPoints map[wire.OutPoint]struct{}
	watchedTxs       map[chainhash.Hash]struct{}
	mempool map[chainhash.Hash]struct{}
	expiredMempool map[int32]map[chainhash.Hash]struct{}
	notificationQueue *ConcurrentQueue
	zmqTxNtfns chan *wire.MsgTx
	zmqBlockNtfns chan *wire.MsgBlock
	quit chan struct{}
	wg   sync.WaitGroup
}
var _ Interface = (*BitcoindClient)(nil)
func (c *BitcoindClient) BackEnd() string {
	return "bitcoind"
}
func (c *BitcoindClient) GetBestBlock() (*chainhash.Hash, int32, error) {
	bcinfo, err := c.chainConn.client.GetBlockChainInfo()
	if err != nil {
		return nil, 0, err
	}
	hash, err := chainhash.NewHashFromStr(bcinfo.BestBlockHash)
	if err != nil {
		return nil, 0, err
	}
	return hash, bcinfo.Blocks, nil
}
func (c *BitcoindClient) GetBlockHeight(hash *chainhash.Hash) (int32, error) {
	header, err := c.chainConn.client.GetBlockHeaderVerbose(hash)
	if err != nil {
		return 0, err
	}
	return header.Height, nil
}
func (c *BitcoindClient) GetBlock(hash *chainhash.Hash) (*wire.MsgBlock, error) {
	return c.chainConn.client.GetBlock(hash)
}
func (c *BitcoindClient) GetBlockVerbose(
	hash *chainhash.Hash) (*btcjson.GetBlockVerboseResult, error) {
	return c.chainConn.client.GetBlockVerbose(hash, true)
}
func (c *BitcoindClient) GetBlockHash(height int64) (*chainhash.Hash, error) {
	return c.chainConn.client.GetBlockHash(height)
}
func (c *BitcoindClient) GetBlockHeader(
	hash *chainhash.Hash) (*wire.BlockHeader, error) {
	return c.chainConn.client.GetBlockHeader(hash)
}
func (c *BitcoindClient) GetBlockHeaderVerbose(
	hash *chainhash.Hash) (*btcjson.GetBlockHeaderVerboseResult, error) {
	return c.chainConn.client.GetBlockHeaderVerbose(hash)
}