Commit 54cba8ca authored by yacovm's avatar yacovm
Browse files

[FAB-14696] Proper lastConfigMetadata in inactiveChain



This change set properly sets the last config metadata for inactive chains.
Inactive chains are chains that the orderer isn't part of, but still has the
genesis block in its ledger, to avoid state forks.

The replication code artificially creates a genesis block for the channel from
the channel creation transaction.

Change-Id: I57a4fbb609ae447d25041e64aaf71e151e83f68f
Signed-off-by: default avataryacovm <yacovm@il.ibm.com>
parent e188e398
......@@ -613,8 +613,10 @@ func ChannelCreationBlockToGenesisBlock(block *common.Block) (*common.Block, err
Metadata: make([][]byte, 4),
}
block.Metadata = metadata
metadata.Metadata[common.BlockMetadataIndex_LAST_CONFIG] = utils.MarshalOrPanic(&common.LastConfig{
Index: 0,
metadata.Metadata[common.BlockMetadataIndex_LAST_CONFIG] = utils.MarshalOrPanic(&common.Metadata{
Value: utils.MarshalOrPanic(&common.LastConfig{Index: 0}),
// This is a genesis block, peer never verify this signature because we can't bootstrap
// trust from an earlier block, hence there are no signatures here.
})
return block, nil
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment