SHA256
Исправить запись первого блока free-цепочки
This commit is contained in:
+6
-2
@@ -66,14 +66,18 @@ public final class BlockchainWriter {
|
|||||||
try (Connection c = shine.db.DbController.getInstance().getConnection()) {
|
try (Connection c = shine.db.DbController.getInstance().getConnection()) {
|
||||||
c.setAutoCommit(false);
|
c.setAutoCommit(false);
|
||||||
try {
|
try {
|
||||||
blocksDAO.insert(c, be);
|
// blocks_store имеет внешний ключ (login, fork_number) на
|
||||||
|
// blockchain_state_store. Сначала создаём/обновляем runtime-state:
|
||||||
|
// это позволяет без отдельной предварительной записи принять
|
||||||
|
// самый первый HEADER ранее импортированной цепочки.
|
||||||
st.setLastBlockNumber(block.blockNumber);
|
st.setLastBlockNumber(block.blockNumber);
|
||||||
st.setLastBlockHash(block.getHash32());
|
st.setLastBlockHash(block.getHash32());
|
||||||
st.setFileSizeBytes(st.getFileSizeBytes() + rawDataItem.length);
|
st.setFileSizeBytes(st.getFileSizeBytes() + rawDataItem.length);
|
||||||
st.setUpdatedAtMs(nowMs);
|
st.setUpdatedAtMs(nowMs);
|
||||||
stateDAO.upsert(c, st);
|
stateDAO.upsert(c, st);
|
||||||
|
|
||||||
|
blocksDAO.insert(c, be);
|
||||||
|
|
||||||
if (userParamEntry != null) userParamsDAO.upsertIfNewer(c, userParamEntry);
|
if (userParamEntry != null) userParamsDAO.upsertIfNewer(c, userParamEntry);
|
||||||
if (channelNameStateEntry != null) channelNameStateDAO.insert(c, channelNameStateEntry);
|
if (channelNameStateEntry != null) channelNameStateDAO.insert(c, channelNameStateEntry);
|
||||||
if (channelMetaUpdateEntry != null) channelNameStateDAO.updateMeta(c, channelMetaUpdateEntry);
|
if (channelMetaUpdateEntry != null) channelNameStateDAO.updateMeta(c, channelMetaUpdateEntry);
|
||||||
|
|||||||
+1
-1
@@ -1,2 +1,2 @@
|
|||||||
client.version=1.20.20
|
client.version=1.20.20
|
||||||
server.version=1.16.16
|
server.version=1.16.17
|
||||||
|
|||||||
Reference in New Issue
Block a user