| 110 | } // namespace |
| 111 | |
| 112 | static bool UpdateBlockIndexDB(CBlockIndex *pIndex) { |
| 113 | CDiskBlockIndex diskBlockIndex; |
| 114 | if (!pCdMan->pBlockIndexDb->GetBlockIndex(pIndex->GetBlockHash(), diskBlockIndex)) { |
| 115 | return ERRORMSG("the index of block=%s not exist in db", pIndex->GetIdString()); |
| 116 | } |
| 117 | (CBlockIndex&)diskBlockIndex = *pIndex; |
| 118 | if (!pCdMan->pBlockIndexDb->WriteBlockIndex(diskBlockIndex)) { |
| 119 | return ERRORMSG("save index of block=%s not to db failed", pIndex->GetIdString()); |
| 120 | } |
| 121 | return true; |
| 122 | } |
| 123 | |
| 124 | ////////////////////////////////////////////////////////////////////////////// |
| 125 | // |
no test coverage detected