블록체인 블록생성확률 분포, CChain 클래스 구조

Words
65
Reading
1 min
Listen
Play
8y


블록타임 10분인 경우 누적분포도(크게보려면 그림위에서 마우스 우측버튼 "새탭에서 이미지 열기"선택합니다)

블록 생성확률 분포

5분이내에 40프로 확률로 블록이 발견되고, 10분이내에 약 65% 확률로 블록이 발견됩니다. 즉 비트코인의 경우 10분이내에 블록이 발견되는 확률이 약 65%입니다.

최신 블록생성되자 마자 보낸 트랜잭션인 경우에 10분이내에 1컨펌확률은 65%이고 5분이내에 1컨펌확률은 40%입니다. 더 확장하면 최신 블록이 생성된지 5분후에 트랜잭선을 보낸경우 추가 5분내(총 10분이 됨)에 1컨펌이 될 확률은 65%입니다.

CChain 클래스

private:
std::vector< CBlockIndex * >    vChain

public:
CBlockIndex *   Genesis () const
CBlockIndex *   Tip () const
CBlockIndex *   operator[] (int nHeight) const
bool    Contains (const CBlockIndex *pindex) const
 CBlockIndex *  Next (const CBlockIndex *pindex) const
int     Height () const
CBlockLocator   GetLocator (const CBlockIndex *pindex=nullptr) const
CBlockIndex *   FindEarliestAtLeast (int64_t nTime) const

void    SetTip (CBlockIndex *pindex)
    Set/initialize a chain with a given tip. More...
        체인을 마지막이 pindex블록패턴으로 초기화 한다. 

const CBlockIndex *     FindFork (const CBlockIndex *pindex) const
    Find the last common block between this chain and a block index entry. More...
        포크되기 전 공통이 되는 마지막 블록을 찾는다

함수
CBlockIndex *CBlockIndex::GetAncestor(int height)
    height높이에 해당하는블록을 찾는다.
블록체인 블록생성확률 분포, CChain 클래스 구조 | Ecency