func TestBacktrackToCurrentPath(t *testing.T) {
	if testing.Short() {
		t.SkipNow()
	}
	t.Parallel()
	cst, err := createConsensusSetTester(t.Name())
	if err != nil {
		t.Fatal(err)
	}
	defer cst.Close()
	pb := cst.cs.dbCurrentProcessedBlock()
	nodes := cst.cs.dbBacktrackToCurrentPath(pb)
	if len(nodes) != 1 {
		t.Fatal("backtracking to the current node gave incorrect result")
	}
	if nodes[0].Block.ID() != pb.Block.ID() {
		t.Error("backtrack returned the wrong node")
	}
	child0, _ := cst.miner.FindBlock()
	child1, _ := cst.miner.FindBlock()  
	err = cst.cs.AcceptBlock(child0)
	if err != nil {
		t.Fatal(err)
	}
	err = cst.cs.AcceptBlock(child1)
	if err != modules.ErrNonExtendingBlock {
		t.Fatal(err)
	}
	pb, err = cst.cs.dbGetBlockMap(child1.ID())
	if err != nil {
		t.Fatal(err)
	}
	nodes = cst.cs.dbBacktrackToCurrentPath(pb)
	if len(nodes) != 2 {
		t.Error("backtracking grabbed wrong number of nodes")
	}
	parent, err := cst.cs.dbGetBlockMap(pb.Block.ParentID)
	if err != nil {
		t.Fatal(err)
	}
	if nodes[0].Block.ID() != parent.Block.ID() {
		t.Error("grabbed the wrong block as the common block")
	}
	if nodes[1].Block.ID() != pb.Block.ID() {
		t.Error("backtracked from the wrong node")
	}
}
TestBacktrackToCurrentPath probes the backtrackToCurrentPath method of the
consensus set.
package consensus
import (
	"testing"
	"github.com/NebulousLabs/Sia/modules"
)