Эх сурвалжийг харах

core: Provide a public accessor for ChainConfig

This is necessary for external users of the go-ethereum code who want to, for instance, build a custom node that plays back transactions, as core.ApplyTransaction requires a ChainConfig as a parameter.
Nicholas Johnson 9 жил өмнө
parent
commit
c74a575725
1 өөрчлөгдсөн 3 нэмэгдсэн , 0 устгасан
  1. 3 0
      core/blockchain.go

+ 3 - 0
core/blockchain.go

@@ -1213,3 +1213,6 @@ func (self *BlockChain) GetBlockHashesFromHash(hash common.Hash, max uint64) []c
 func (self *BlockChain) GetHeaderByNumber(number uint64) *types.Header {
 	return self.hc.GetHeaderByNumber(number)
 }
+
+// Config retrieves the blockchain's chain configuration.
+func (self *BlockChain) Config() *ChainConfig { return self.config }