Blockchain

altcoin debug.log 顯示 ERROR: CTxDB::LoadBlockIndex() : Failed stake modifier checkpoint height=0

  • September 14, 2018

到目前為止我做了什麼:

  • 生成新的創世塊
  • 生成新的 MerkleRoot
  • 更新 MerkleRoot
  • 更新了創世區塊值
  • 註釋掉這些行
  • 在 CentOS 6 上編譯
  • 創建altcoin.conf
rpcuser=someuser
rpcpassword=somepassword
  • 發射./altcoin

在這一點上,一切似乎都很好,但是……

  • ./altcoind getinfo

顯示:

{
   "version" : 60300,
   "protocolversion" : 60001,
   "walletversion" : 60000,
   "balance" : 0,
   "blocks" : 0,
   "connections" : 1,
   "proxy" : "",
   "difficulty" : 1.00000000,
   "testnet" : false,
   "keypoololdest" : 1400530204,
   "keypoolsize" : 104,
   "paytxfee" : 0.00000000,
   "mininput" : 0.00010000,
   "errors" : ""
}
  • 所以我嘗試使用內部礦工來探勘第一個區塊./altcoind setgenerate true 8
  • 在檢查進度時./altcoind getmininginfo我得到了奇怪的輸出

這表明:

{
   "blocks" : 0,
   "currentblocksize" : 0,
   "currentblocktx" : 0,
   "difficulty" : 1.00000000,
   "errors" : "",
   "generate" : true,
   "genproclimit" : 4,
   "hashespersec" : 0,
   "networkhashps" : 1.46543,
   "pooledtx" : 0,
   "testnet" : false
}

在這一點上,我遇到了問題./altcoind stop,當我嘗試再次啟動它時,debug.log顯示:

Altcoin Network: genesis=0x00000000324a1b505ecd nBitsLimit=0x1d00ffff nBitsInitial=0x1c00ffff nStakeMinAge=604800 nCoinbaseMaturity=500 nModifierInterval=21600
ERROR: CTxDB::LoadBlockIndex() : Failed stake modifier checkpoint height=0, modifier=0x0000000000000000
block index               1ms
Loading wallet...
nFileVersion = 60300
Error loading blkindex.dat
wallet                  301ms
Done loading
mapBlockIndex.size() = 1
nBestHeight = -1
setKeyPool.size() = 101
mapWallet.size() = 0
mapAddressBook.size() = 1

一遍又一遍地出現同樣的錯誤……我已經有一段時間了……

可以嗎,請指點我正確的方向。謝謝

更新1:

  • 刪除了所有內容,~/.altcoin/除了altcoin.conf
  • 推出./altcoind
  • 發布./altcoind setgenerate true 4

在這一點上,我發現./altcoind啟動時沒有抱怨權益修改器,儘管每次我想重新啟動時我都必須刪除內容,~/.altcoin/否則會彈出錯誤。

輸出debug.log

AltCoin version v0.5.4.0-unk-beta ()
Default data directory /root/.thecoin
Loading addresses...
dbenv.open LogDir=/root/.altcoin/database ErrorFile=/root/.altcoin/db.log
Loaded 0 addresses
addresses                30ms
Loading block index...
AltCoin Network: genesis=0x00000000324a1b505ecd nBitsLimit=0x1d00ffff nBitsInitial=0x1c00ffff nStakeMinAge=604800 nCoinbaseMaturity=500     nModifierInterval=21600
00000000324a1b505ecd77b793658f4fa6cd386653fdabd7d1c66907177174d6
00000000324a1b505ecd77b793658f4fa6cd386653fdabd7d1c66907177174d6
d8098e7eb449eed16c09fd7c97dec2acd1ec386ced36cf970a05c92fc2c0a05b
CBlock(hash=00000000324a1b505ecd, ver=1, hashPrevBlock=00000000000000000000, hashMerkleRoot=d8098e7eb4, nTime=1508926967, nBits=1d00ffff, nNonce=2600258680, vtx=1, vchBlockSig=)
 Coinbase(hash=d8098e7eb4, nTime=1508926967, ver=1, vin.size=1, vout.size=1, nLockTime=0)
   CTxIn(COutPoint(0000000000, -1), coinbase 04ffff001d020f274c4c205468652045636f6e6f6d697374202d2054686520626f79636f7474206f662051617461722069732068757274696e672069747320656e666f7263657273202d204f63742031392032303137)
   CTxOut(empty)
 vMerkleTree: d8098e7eb4
SetBestChain: new best=00000000324a1b505ecd  height=0  trust=1  moneysupply=0.00
Upgrade Info: v0.5+ txdb initialization
ResetSyncCheckpoint: pending for sync-checkpoint ab0dad4b10d2370f009ed6df6effca1ba42f01d5070d6b30afeedf6463fbe7a2
ResetSyncCheckpoint: sync-checkpoint reset to 00000000324a1b505ecd77b793658f4fa6cd386653fdabd7d1c66907177174d6
Upgrade Info: no txdb upgrade v0.3->v0.4 detected.
Upgrade Info: v0.5+ no txdb upgrade detected.
block index               4ms
Loading wallet...
nFileVersion = 60300
Performing wallet upgrade to 60000
keypool added key 1, size=1
keypool added key 2, size=2
keypool added key 3, size=3
...
...
keypool added key 101, size=101
keypool reserve 1
keypool keep 1
wallet                  755ms
Done loading
mapBlockIndex.size() = 1
nBestHeight = 0
setKeyPool.size() = 100
mapWallet.size() = 0
mapAddressBook.size() = 1
Bound to port 11111
Added 1.1.1.90:11111 from 127.0.0.1: 0 tried, 1 new
Added 1.1.1.1:11111 from 127.0.0.1: 0 tried, 2 new
ThreadRPCServer started
ipv4 venet0: 127.0.0.1
ipv4 venet0:0: 2.2.2.62
addrLocalHost = 2.2.2.62:11111
IRC seeding/communication disabled
ThreadSocketHandler started
ThreadOpenAddedConnections started
trying connection 1.1.1.90:11111 lastseen=-391515.5hrs
ThreadOpenConnections started
ThreadMessageHandler started
ThreadStakeMinter started
CPUMiner started for proof-of-stake
ThreadDNSAddressSeed started
Loading addresses from DNS seeds (could take a while)
Added 9 addresses from 0:0:0:0:0:0:0:0: 0 tried, 11 new
connected 1.1.1.90:11111
Added time data, samples 2, offset +0 (+0 minutes)
Moving 1.1.1.90:11111 to tried
version message: version 60006, blocks=0
getblocks -1 to 00000000000000000000 limit 500
trying connection 1.1.1.9:11111 lastseen=-391515.5hrs
Added 13 addresses from 1.1.1.90: 1 tried, 23 new
GetMyExternalIP() received [2.2.2.62] 2.2.2.62:0
GetMyExternalIP() returned 2.2.2.62
connected 198.143.186.9:11111
Added 21 addresses from 0:0:0:0:0:0:0:0: 1 tried, 44 new
...
...
2017-10-31 13:15:58 UTC Flushing wallet.dat    
...
4 processors
Starting 4 BitcoinMiner threads
CPUMiner started for proof-of-work
CPUMiner started for proof-of-work
CPUMiner started for proof-of-work
CPUMiner started for proof-of-work
...
...
ThreadRPCServer method=getmininginfo

儘管它已啟動並執行並且兩個節點都相互連接,但./altcoind getinfo和的輸出./altcoind getmininginfo仍然相同。

更新 2

// 權益修改器的硬檢查點,以確保它們是確定性靜態 std::map mapStakeModifierCheckpoints = boost::assign::map_list_of ( 0, 0x0000000000000000 ) // ( 0, 0x0e00670bu ) // ( 19080, 0xad4e4d29u ) // ( 30583, 0xdc7bf136u) // (99999, 0xf555cfd2u) // (219999, 0x91b7444du);

  • 重新編譯
  • 刪除~/.altcoin/文件夾的所有內容
  • 添加altcoin.conf
  • 推出./altcoind
  • 發出./altcoind getinfo- 輸出仍然相同
  • 問題./altcoind setgenerate true 4-
  • debug.log輸出和之前一樣
  • 發布./altcoind stop
  • 推出./altcoind

此時我再次失敗並顯示相同的錯誤消息

AltCoin Network: genesis=0x00000000324a1b505ecd nBitsLimit=0x1d00ffff nBitsInitial=0x1c00ffff nStakeMinAge=604800 nCoinbaseMaturity=500 nModifierInterval=21600
ERROR: CTxDB::LoadBlockIndex() : Failed stake modifier checkpoint height=0, modifier=0x0000000000000000

看起來您沒有更改此處找到的權益修改器檢查點:https ://github.com/peercoin/peercoin/blob/master-0.5/src/kernel.cpp#L40 。您將需要更改這些權益修改器檢查點以匹配您的檢查點塊的權益修改器。

如果您不想檢查這些檢查點,您可以更改此功能:https ://github.com/peercoin/peercoin/blob/master-0.5/src/kernel.cpp#L508始終返回 true。那應該“解決”您遇到的這個問題。

引用自:https://bitcoin.stackexchange.com/questions/61384