Date
1 - 3 of 3
One suggestion to the fuction named createLedgerID
Manish
To correct my previous reply - Dave reminded me of what we wanted to achieve here and the purpose of passing the block in this function at the first place. So, this is a bug and thanks Dave for opening the Jira for this - https://jira.hyperledger.org/browse/FAB-10141 On Wed, May 16, 2018 at 1:00 PM, Manish <manish.sethi@...> wrote:
|
|
Manish
Somehow, hit the ‘reply’ instead of reply all... ---------- Forwarded message ---------- From: Manish Sethi <manish.sethi@...> Date: Wed, May 16, 2018 at 11:56 AM Subject: Re: [Hyperledger Fabric] One suggestion to the fuction named createLedgerID To: wangzp <wangzhipengxlj@...> Yes, it can be be dropped. As you see that this parameter is not used in this function as such. Thanks, Manish On Wed, May 16, 2018 at 11:37 AM, wangzp <wangzhipengxlj@...> wrote:
|
|
??? <wangzhipengxlj@...>
func (s *idStore) createLedgerID(ledgerID string, gb *common.Block) error { key := s.encodeLedgerKey(ledgerID) var val []byte var err error if val, err = proto.Marshal(gb); err != nil { return err } if val, err = s.db.Get(key); err != nil { return err } if val != nil { return ErrLedgerIDExists } batch := &leveldb.Batch{} batch.Put(key, val) batch.Delete(underConstructionLedgerKey) return s.db.WriteBatch(batch, true) } func (s *idStore) ledgerIDExists(ledgerID string) (bool, error) { key := s.encodeLedgerKey(ledgerID) val := []byte{} err := error(nil) if val, err = s.db.Get(key); err != nil { return false, err } return val != nil, nil } Two functions in ` core/ledger/kvledger/kv_ledger_provider.go ` in version v1.10;In ` createLedgerID() `, put `nil ` value with the key of `ledgerID ` into the `ledgerProviderDB ` . Why not put the genesis block into the `ledgerProviderDB ` ? When a crash occurs, the ledger can still be generated with the genesis block after restart.
|
|