{"modulePath":"github.com/chainopen/matrixchaincode","version":"v0.0.0-20190924071332-ddf2b42e220f","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package core\n\nPackage core implements the Matrix consensus protocol.\n\nCopyright (c) 2018 The MATRIX Authors Distributed under the MIT software license, see the accompanying file COPYING or [http://www.opensource.org/licenses/mit-license.php](http://www.opensource.org/licenses/mit-license.php)\n\nCopyright (c) 2018 The MATRIX Authors Distributed under the MIT software license, see the accompanying file COPYING or [http://www.opensource.org/licenses/mit-license.php](http://www.opensource.org/licenses/mit-license.php)\n\nCopyright (c) 2018 The MATRIX Authors Distributed under the MIT software license, see the accompanying file COPYING or [http://www.opensource.org/licenses/mit-license.php](http://www.opensource.org/licenses/mit-license.php)\n\nCopyright (c) 2018 The MATRIX Authors Distributed under the MIT software license, see the accompanying file COPYING or [http://www.opensource.org/licenses/mit-license.php](http://www.opensource.org/licenses/mit-license.php)\n\nCopyright (c) 2018 The MATRIX Authors Distributed under the MIT software license, see the accompanying file COPYING or [http://www.opensource.org/licenses/mit-license.php](http://www.opensource.org/licenses/mit-license.php)\n\nCopyright (c) 2018 The MATRIX Authors Distributed under the MIT software license, see the accompanying file COPYING or [http://www.opensource.org/licenses/mit-license.php](http://www.opensource.org/licenses/mit-license.php)\n\nCopyright (c) 2018 The MATRIX Authors Distributed under the MIT software license, see the accompanying file COPYING or [http://www.opensource.org/licenses/mit-license.php](http://www.opensource.org/licenses/mit-license.php)\n\nCopyright (c) 2018 The MATRIX Authors Distributed under the MIT software license, see the accompanying file COPYING or [http://www.opensource.org/licenses/mit-license.php](http://www.opensource.org/licenses/mit-license.php)\n\nCopyright (c) 2018 The MATRIX Authors Distributed under the MIT software license, see the accompanying file COPYING or [http://www.opensource.org/licenses/mit-license.php](http://www.opensource.org/licenses/mit-license.php)\n\nCopyright (c) 2018 The MATRIX Authors Distributed under the MIT software license, see the accompanying file COPYING or [http://www.opensource.org/licenses/mit-license.php](http://www.opensource.org/licenses/mit-license.php)\n\n## Constants\n\n```go\nconst (\n\n\t// BlockChainVersion ensures that an incompatible database forces a resync from scratch.\n\tBlockChainVersion = 3\n\tModuleName        = \"blockchain\"\n)\n```\n\n```go\nconst (\n\tSendFloodSN\n\tGetTxbyN\n\tRecvTxbyN //\n\tRecvErrTx //\n\tBroadCast //\n\tGetConsensusTxbyN\n\tRecvConsensusTxbyN\n)\n```\n消息类型\n\n```go\nconst (\n\tRewardFullRate = uint64(10000)\n)\n```\n\n## Variables\n\n```go\nvar (\n\tErrNoGenesis = errors.New(\"Genesis not found in chain\")\n\n\tSaveSnapPeriod uint64 = 300\n\tSaveSnapStart  uint64 = 0\n\tCleanMemFlgNum int    = 0\n)\n```\n\n```go\nvar (\n\tSlashCfg                 = mc.BlockProduceSlashCfg{Switcher: true, LowTHR: 1, ProhibitCycleNum: 2}\n\tErrWriteSlashCfgStateErr = errors.Errorf(\"Init Set SlashCfg Err\")\n\tErrGetSlashCfgStateErr   = errors.Errorf(\"Get SlashCfg Err\")\n\tErrStatePtrIsNil         = errors.Errorf(\"State Ptr Is Null\")\n\tErrHeaderPtrIsNil        = errors.Errorf(\"Header Ptr Is Null\")\n\tErrSlashCfgPtrIsNil      = errors.Errorf(\"Slash Cfg Ptr Is Null\")\n)\n```\n\n```go\nvar (\n\tAllGenesisJson = `{\n    \"nettopology\":{\n        \"Type\":0,\n        \"NetTopologyData\":[\n            {\n                \"Account\":\"MAN.44EuST4f2vLeEMw2bsMWmBYqLMBhi\",\n                \"Position\":8192\n            },\n            {\n                \"Account\":\"MAN.3t9Ser2UjrXRT6erVKytjHtT4ohdX\",\n                \"Position\":8193\n            },\n            {\n                \"Account\":\"MAN.2MSWsig8iv45CDTrPn1XMzvZnR52v\",\n                \"Position\":8194\n            },\n            {\n                \"Account\":\"MAN.EXnVsEqjyPLHZySL9y53WgXjiFmN\",\n                \"Position\":8195\n            },\n            {\n                \"Account\":\"MAN.2QR75feL9KBfaezJwhuM2VCPpqkyT\",\n                \"Position\":8196\n            },\n            {\n                \"Account\":\"MAN.95Tro9wLULb6rNWNCT6QDwVBiDds\",\n                \"Position\":8197\n            },\n            {\n                \"Account\":\"MAN.375qsgtLc25bJv2Cf9ffnEZPDhyvd\",\n                \"Position\":8198\n            },\n            {\n                \"Account\":\"MAN.2RwBWjBykMiGRu7STzYdNzXUMyh8z\",\n                \"Position\":8199\n            },\n            {\n                \"Account\":\"MAN.2zjKitA4uydg5kSZLjtSNHzDtx6k8\",\n                \"Position\":8200\n            },\n            {\n                \"Account\":\"MAN.4kaowsz37i1WRrPrkg4g8qYQHtJ7\",\n                \"Position\":8201\n            },\n            {\n                \"Account\":\"MAN.3B1wx2wo5anTTMjnyWXAA4FQL5opx\",\n                \"Position\":8202\n            },\n            {\n                \"Account\":\"MAN.3pm3iXgrY9SYhhc9aS6DQCp4qj66t\",\n                \"Position\":8203\n            },\n            {\n                \"Account\":\"MAN.4M8Svax1v6yGitwB4E2ueBtw2TesK\",\n                \"Position\":8204\n            },\n            {\n                \"Account\":\"MAN.3abRtpG81TPY8YwenowwgmJ8SuLpy\",\n                \"Position\":8205\n            },\n            {\n                \"Account\":\"MAN.2pqHNWtbpKKaLU71RY6TZeaQjjQnR\",\n                \"Position\":8206\n            },\n            {\n                \"Account\":\"MAN.3Wf4yzVkbou1bFzkpbJUdu5rqq1se\",\n                \"Position\":8207\n            },\n            {\n                \"Account\":\"MAN.U5mNRj4q7jQzbVE4tWcjsvSXTseS\",\n                \"Position\":8208\n            },\n            {\n                \"Account\":\"MAN.2ZPbpaCyuEEf1WR3C6dCCFFqnH25J\",\n                \"Position\":8209\n            },\n            {\n                \"Account\":\"MAN.3ByNBjw4E7gcxD3uGKtAZYLYUD5xi\",\n                \"Position\":8210\n            },\n            {\n                \"Account\":\"MAN.2tSj5kjwwaiTPt4XnHAaEWBYBo9gK\",\n                \"Position\":0\n            },\n            {\n                \"Account\":\"MAN.4ZnJrUuM2bfFmdUaivrqGio28hZwd\",\n                \"Position\":1\n            },\n            {\n                \"Account\":\"MAN.49fxdGyiWPQ3evpMCNChqvCq3qzMC\",\n                \"Position\":2\n            },\n            {\n                \"Account\":\"MAN.3Ugik7ZsLoaNgX51kCJEWz1ZjxQgW\",\n                \"Position\":3\n            },\n            {\n                \"Account\":\"MAN.kwPCJkajT2op7rVgYKDqcQu2KEQn\",\n                \"Position\":4\n            },\n            {\n                \"Account\":\"MAN.ksFr4mKPfZhm2PrFdEUSoLoDsKAZ\",\n                \"Position\":12288\n            },\n            {\n                \"Account\":\"MAN.42bUyszBXL3feeDHztWMiUJCRzBRP\",\n                \"Position\":12289\n            },\n            {\n                \"Account\":\"MAN.2NVAVDc7AJGNP3Ghwfv8dz59kUvjM\",\n                \"Position\":12290\n            },\n            {\n                \"Account\":\"MAN.e33HPpmmZC98ADkZUXigS1nDFfaA\",\n                \"Position\":12291\n            }\n        ]\n    },\n    \"alloc\":{\n        \"MAN.1111111111111111111B8\":{\n            \"storage\":{\n                \"0x0000000000000000000000000000000000000000000000000000000a444e554d\":\"0x000000000000000000000000000000000000000000000000000000000000001c\",\n                \"0x0000000000000000000000000000000000000000000a44490000000000000000\":\"0x000000000000000000000000db588e42D894EDE75000860fC0F4D969393ac514\",\n                \"0x0000000000000000000000000000000000000000000a44490000000000000001\":\"0x000000000000000000000000Ceda8D254c1925a79fd4cDe842A86e5273400eA4\",\n                \"0x0000000000000000000000000000000000000000000a44490000000000000002\":\"0x000000000000000000000000611318F1430AD50c540677089053dD7123e3B9b1\",\n                \"0x0000000000000000000000000000000000000000000a44490000000000000003\":\"0x00000000000000000000000010BeC6Cd8fEf4393b072d1Ddf853E753Cd3D222c\",\n                \"0x0000000000000000000000000000000000000000000a44490000000000000004\":\"0x00000000000000000000000064C1D85AF78c82Bf7a59030E87114025F76750CE\",\n                \"0x0000000000000000000000000000000000000000000a44490000000000000005\":\"0x00000000000000000000000009fEEa325F03230969B02cAEC585256D1B26ca30\",\n                \"0x0000000000000000000000000000000000000000000a44490000000000000006\":\"0x00000000000000000000000097161fE11Dba5a5daA85D1647eA79d72a3cf7385\",\n                \"0x0000000000000000000000000000000000000000000a44490000000000000007\":\"0x00000000000000000000000066A2F34C7ce30A908F7ed9D5CAE33E939404cc47\",\n                \"0x0000000000000000000000000000000000000000000a44490000000000000008\":\"0x0000000000000000000000008f3922BebdDECB25D5513E393abBaA00C5dD5Ee1\",\n                \"0x0000000000000000000000000000000000000000000a44490000000000000009\":\"0x00000000000000000000000004A48442762386D1954895a3d1977457145e8Ca7\",\n                \"0x0000000000000000000000000000000000000000000a4449000000000000000a\":\"0x0000000000000000000000009bf41d7a8aB4c11a4D0C5c5f451c06bf191E1593\",\n                \"0x0000000000000000000000000000000000000000000a4449000000000000000b\":\"0x000000000000000000000000CaA9c4aFcA7584462C1663DDE671adAc5532605f\",\n                \"0x0000000000000000000000000000000000000000000a4449000000000000000c\":\"0x000000000000000000000000f03F2c53784149f95535DBc707277363C6DB45A4\",\n                \"0x0000000000000000000000000000000000000000000a4449000000000000000d\":\"0x000000000000000000000000b921CBa7b3b0eEB811E462bd096F7432cdCD7745\",\n                \"0x0000000000000000000000000000000000000000000a4449000000000000000e\":\"0x00000000000000000000000082F984c3D66c4df8F2D68CedA0cd5F2D1897dD2b\",\n                \"0x0000000000000000000000000000000000000000000a4449000000000000000f\":\"0x000000000000000000000000B442685E3730F1441aE712E4F9E27946b8471902\",\n                \"0x0000000000000000000000000000000000000000000a44490000000000000010\":\"0x000000000000000000000000218416320cc42b8FCD2a3700bc54d5eD668d6d01\",\n                \"0x0000000000000000000000000000000000000000000a44490000000000000011\":\"0x0000000000000000000000006fDcfade41750838F48f3Ec1fFDFdB4A3A42f746\",\n                \"0x0000000000000000000000000000000000000000000a44490000000000000012\":\"0x0000000000000000000000009D22D3DD44b0d7F073C78BCe7c1352175FB7B997\",\n                \"0x0000000000000000000000000000000000000000000a44490000000000000013\":\"0x000000000000000000000000877192DB751fD2b63C4CF0078221B2d0DAaa01eF\",\n                \"0x0000000000000000000000000000000000000000000a44490000000000000014\":\"0x000000000000000000000000fFe7c96064D3b4C185B1E4B22D3E692A01Ab2FbE\",\n                \"0x0000000000000000000000000000000000000000000a44490000000000000015\":\"0x000000000000000000000000e2117fF2836eD3f33B95bb8dBb4ACE9B4DB90e2E\",\n                \"0x0000000000000000000000000000000000000000000a44490000000000000016\":\"0x000000000000000000000000B1D1CAD653D38B90b586F7755963711f5e37E469\",\n                \"0x0000000000000000000000000000000000000000000a44490000000000000017\":\"0x0000000000000000000000003660302D6614EF96578EFC3301cc527054Bc8919\",\n                \"0x0000000000000000000000000000000000000000000a44490000000000000018\":\"0x0000000000000000000000003649A589684ba446f119e7040c39cCd7Ab9865c5\",\n                \"0x0000000000000000000000000000000000000000000a44490000000000000019\":\"0x000000000000000000000000d94F53F17a1D2B921B58f9BB1a3cAae1075ff3B0\",\n                \"0x0000000000000000000000000000000000000000000a4449000000000000001a\":\"0x000000000000000000000000625E61a2Ec4aB70dF50ccD6CC46B85db6Aa001f0\",\n                \"0x0000000000000000000000000000000000000000000a4449000000000000001b\":\"0x0000000000000000000000002dD55E3F620c8DE08CBEBB9BF6Cd88d7b29aEd25\",\n                \"0x0000000000000000000000db588e42D894EDE75000860fC0F4D969393ac51444\":\"0x00000000000000000000000000000000000000000000152d02c7e14af6800000\",\n                \"0x0000000000000000000000Ceda8D254c1925a79fd4cDe842A86e5273400eA444\":\"0x00000000000000000000000000000000000000000000152d02c7e14af6800000\",\n                \"0x0000000000000000000000611318F1430AD50c540677089053dD7123e3B9b144\":\"0x00000000000000000000000000000000000000000000152d02c7e14af6800000\",\n                \"0x000000000000000000000010BeC6Cd8fEf4393b072d1Ddf853E753Cd3D222c44\":\"0x00000000000000000000000000000000000000000000152d02c7e14af6800000\",\n                \"0x000000000000000000000064C1D85AF78c82Bf7a59030E87114025F76750CE44\":\"0x00000000000000000000000000000000000000000000152d02c7e14af6800000\",\n                \"0x000000000000000000000009fEEa325F03230969B02cAEC585256D1B26ca3044\":\"0x00000000000000000000000000000000000000000000152d02c7e14af6800000\",\n                \"0x000000000000000000000097161fE11Dba5a5daA85D1647eA79d72a3cf738544\":\"0x00000000000000000000000000000000000000000000152d02c7e14af6800000\",\n                \"0x000000000000000000000066A2F34C7ce30A908F7ed9D5CAE33E939404cc4744\":\"0x00000000000000000000000000000000000000000000152d02c7e14af6800000\",\n                \"0x00000000000000000000008f3922BebdDECB25D5513E393abBaA00C5dD5Ee144\":\"0x00000000000000000000000000000000000000000000152d02c7e14af6800000\",\n                \"0x000000000000000000000004A48442762386D1954895a3d1977457145e8Ca744\":\"0x00000000000000000000000000000000000000000000152d02c7e14af6800000\",\n                \"0x00000000000000000000009bf41d7a8aB4c11a4D0C5c5f451c06bf191E159344\":\"0x00000000000000000000000000000000000000000000152d02c7e14af6800000\",\n                \"0x0000000000000000000000CaA9c4aFcA7584462C1663DDE671adAc5532605f44\":\"0x00000000000000000000000000000000000000000000152d02c7e14af6800000\",\n                \"0x0000000000000000000000f03F2c53784149f95535DBc707277363C6DB45A444\":\"0x00000000000000000000000000000000000000000000152d02c7e14af6800000\",\n                \"0x0000000000000000000000b921CBa7b3b0eEB811E462bd096F7432cdCD774544\":\"0x00000000000000000000000000000000000000000000152d02c7e14af6800000\",\n                \"0x000000000000000000000082F984c3D66c4df8F2D68CedA0cd5F2D1897dD2b44\":\"0x00000000000000000000000000000000000000000000152d02c7e14af6800000\",\n                \"0x0000000000000000000000B442685E3730F1441aE712E4F9E27946b847190244\":\"0x00000000000000000000000000000000000000000000152d02c7e14af6800000\",\n                \"0x0000000000000000000000218416320cc42b8FCD2a3700bc54d5eD668d6d0144\":\"0x00000000000000000000000000000000000000000000152d02c7e14af6800000\",\n                \"0x00000000000000000000006fDcfade41750838F48f3Ec1fFDFdB4A3A42f74644\":\"0x00000000000000000000000000000000000000000000152d02c7e14af6800000\",\n                \"0x00000000000000000000009D22D3DD44b0d7F073C78BCe7c1352175FB7B99744\":\"0x00000000000000000000000000000000000000000000152d02c7e14af6800000\",\n                \"0x0000000000000000000000877192DB751fD2b63C4CF0078221B2d0DAaa01eF44\":\"0x00000000000000000000000000000000000000000000021e19e0c9bab2400000\",\n                \"0x0000000000000000000000fFe7c96064D3b4C185B1E4B22D3E692A01Ab2FbE44\":\"0x00000000000000000000000000000000000000000000021e19e0c9bab2400000\",\n                \"0x0000000000000000000000e2117fF2836eD3f33B95bb8dBb4ACE9B4DB90e2E44\":\"0x00000000000000000000000000000000000000000000021e19e0c9bab2400000\",\n                \"0x0000000000000000000000B1D1CAD653D38B90b586F7755963711f5e37E46944\":\"0x00000000000000000000000000000000000000000000021e19e0c9bab2400000\",\n                \"0x00000000000000000000003660302D6614EF96578EFC3301cc527054Bc891944\":\"0x00000000000000000000000000000000000000000000021e19e0c9bab2400000\",\n                \"0x00000000000000000000003649A589684ba446f119e7040c39cCd7Ab9865c544\":\"0x00000000000000000000000000000000000000000000152d02c7e14af6800000\",\n                \"0x0000000000000000000000d94F53F17a1D2B921B58f9BB1a3cAae1075ff3B044\":\"0x00000000000000000000000000000000000000000000152d02c7e14af6800000\",\n                \"0x0000000000000000000000625E61a2Ec4aB70dF50ccD6CC46B85db6Aa001f044\":\"0x00000000000000000000000000000000000000000000152d02c7e14af6800000\",\n                \"0x00000000000000000000002dD55E3F620c8DE08CBEBB9BF6Cd88d7b29aEd2544\":\"0x00000000000000000000000000000000000000000000152d02c7e14af6800000\",\n                \"0x00000000000000000000db588e42D894EDE75000860fC0F4D969393ac5144e58\":\"0x000000000000000000000000db588e42D894EDE75000860fC0F4D969393ac514\",\n                \"0x00000000000000000000Ceda8D254c1925a79fd4cDe842A86e5273400eA44e58\":\"0x000000000000000000000000Ceda8D254c1925a79fd4cDe842A86e5273400eA4\",\n                \"0x00000000000000000000611318F1430AD50c540677089053dD7123e3B9b14e58\":\"0x000000000000000000000000611318F1430AD50c540677089053dD7123e3B9b1\",\n                \"0x0000000000000000000010BeC6Cd8fEf4393b072d1Ddf853E753Cd3D222c4e58\":\"0x00000000000000000000000010BeC6Cd8fEf4393b072d1Ddf853E753Cd3D222c\",\n                \"0x0000000000000000000064C1D85AF78c82Bf7a59030E87114025F76750CE4e58\":\"0x00000000000000000000000064C1D85AF78c82Bf7a59030E87114025F76750CE\",\n                \"0x0000000000000000000009fEEa325F03230969B02cAEC585256D1B26ca304e58\":\"0x00000000000000000000000009fEEa325F03230969B02cAEC585256D1B26ca30\",\n                \"0x0000000000000000000097161fE11Dba5a5daA85D1647eA79d72a3cf73854e58\":\"0x00000000000000000000000097161fE11Dba5a5daA85D1647eA79d72a3cf7385\",\n                \"0x0000000000000000000066A2F34C7ce30A908F7ed9D5CAE33E939404cc474e58\":\"0x00000000000000000000000066A2F34C7ce30A908F7ed9D5CAE33E939404cc47\",\n                \"0x000000000000000000008f3922BebdDECB25D5513E393abBaA00C5dD5Ee14e58\":\"0x0000000000000000000000008f3922BebdDECB25D5513E393abBaA00C5dD5Ee1\",\n                \"0x0000000000000000000004A48442762386D1954895a3d1977457145e8Ca74e58\":\"0x00000000000000000000000004A48442762386D1954895a3d1977457145e8Ca7\",\n                \"0x000000000000000000009bf41d7a8aB4c11a4D0C5c5f451c06bf191E15934e58\":\"0x0000000000000000000000009bf41d7a8aB4c11a4D0C5c5f451c06bf191E1593\",\n                \"0x00000000000000000000CaA9c4aFcA7584462C1663DDE671adAc5532605f4e58\":\"0x000000000000000000000000CaA9c4aFcA7584462C1663DDE671adAc5532605f\",\n                \"0x00000000000000000000f03F2c53784149f95535DBc707277363C6DB45A44e58\":\"0x000000000000000000000000f03F2c53784149f95535DBc707277363C6DB45A4\",\n                \"0x00000000000000000000b921CBa7b3b0eEB811E462bd096F7432cdCD77454e58\":\"0x000000000000000000000000b921CBa7b3b0eEB811E462bd096F7432cdCD7745\",\n                \"0x0000000000000000000082F984c3D66c4df8F2D68CedA0cd5F2D1897dD2b4e58\":\"0x00000000000000000000000082F984c3D66c4df8F2D68CedA0cd5F2D1897dD2b\",\n                \"0x00000000000000000000B442685E3730F1441aE712E4F9E27946b84719024e58\":\"0x000000000000000000000000B442685E3730F1441aE712E4F9E27946b8471902\",\n                \"0x00000000000000000000218416320cc42b8FCD2a3700bc54d5eD668d6d014e58\":\"0x000000000000000000000000218416320cc42b8FCD2a3700bc54d5eD668d6d01\",\n                \"0x000000000000000000006fDcfade41750838F48f3Ec1fFDFdB4A3A42f7464e58\":\"0x0000000000000000000000006fDcfade41750838F48f3Ec1fFDFdB4A3A42f746\",\n                \"0x000000000000000000009D22D3DD44b0d7F073C78BCe7c1352175FB7B9974e58\":\"0x0000000000000000000000009D22D3DD44b0d7F073C78BCe7c1352175FB7B997\",\n                \"0x00000000000000000000877192DB751fD2b63C4CF0078221B2d0DAaa01eF4e58\":\"0x000000000000000000000000877192DB751fD2b63C4CF0078221B2d0DAaa01eF\",\n                \"0x00000000000000000000fFe7c96064D3b4C185B1E4B22D3E692A01Ab2FbE4e58\":\"0x000000000000000000000000fFe7c96064D3b4C185B1E4B22D3E692A01Ab2FbE\",\n                \"0x00000000000000000000e2117fF2836eD3f33B95bb8dBb4ACE9B4DB90e2E4e58\":\"0x000000000000000000000000e2117fF2836eD3f33B95bb8dBb4ACE9B4DB90e2E\",\n                \"0x00000000000000000000B1D1CAD653D38B90b586F7755963711f5e37E4694e58\":\"0x000000000000000000000000B1D1CAD653D38B90b586F7755963711f5e37E469\",\n                \"0x000000000000000000003660302D6614EF96578EFC3301cc527054Bc89194e58\":\"0x0000000000000000000000003660302D6614EF96578EFC3301cc527054Bc8919\",\n                \"0x000000000000000000003649A589684ba446f119e7040c39cCd7Ab9865c54e58\":\"0x0000000000000000000000003649A589684ba446f119e7040c39cCd7Ab9865c5\",\n                \"0x00000000000000000000d94F53F17a1D2B921B58f9BB1a3cAae1075ff3B04e58\":\"0x000000000000000000000000d94F53F17a1D2B921B58f9BB1a3cAae1075ff3B0\",\n                \"0x00000000000000000000625E61a2Ec4aB70dF50ccD6CC46B85db6Aa001f04e58\":\"0x000000000000000000000000625E61a2Ec4aB70dF50ccD6CC46B85db6Aa001f0\",\n                \"0x000000000000000000002dD55E3F620c8DE08CBEBB9BF6Cd88d7b29aEd254e58\":\"0x0000000000000000000000002dD55E3F620c8DE08CBEBB9BF6Cd88d7b29aEd25\"\n            },\n            \"balance\":\"2350000000000000000000000\"\n        },\n        \"MAN.2nRsUetjWAaYUizRkgBxGETimfUTz\":{\n            \"balance\":\"10000000000000000000000000\"\n        },\n        \"MAN.2nRsUetjWAaYUizRkgBxGETimfUUs\":{\n            \"balance\":\"25000000000000000000000000\"\n        },\n        \"MAN.2nRsUetjWAaYUizRkgBxGETimfUV2\":{\n            \"balance\":\"10000000000000000000000000\"\n        },\n        \"MAN.4L95KmR3e8eUJvzwK2thft1eKaFYa\":{\n            \"balance\":\"300000000000000000000000000\"\n        },\n        \"MAN.4739r322TyL3xCpbbdohS8NhBgGwi\":{\n            \"balance\":\"200000000000000000000000000\"\n        },\n        \"MAN.2zXWsDtyt7vhVADGTz2yXD6h7WJnF\":{\n            \"balance\":\"87650000000000000000000000\"\n        }\n    },\n    \"mstate\":{\n        \"Broadcasts\":[\"MAN.2y5fqzGDWVznvkd49qqWpXiqjcmJF\"],\n        \"curElect\":[\n            {\n                \"Account\":\"MAN.44EuST4f2vLeEMw2bsMWmBYqLMBhi\",\n                \"Stock\":1,\n                \"Type\":2\n            },\n            {\n                \"Account\":\"MAN.3t9Ser2UjrXRT6erVKytjHtT4ohdX\",\n                \"Stock\":1,\n                \"Type\":2\n            },\n            {\n                \"Account\":\"MAN.2MSWsig8iv45CDTrPn1XMzvZnR52v\",\n                \"Stock\":1,\n                \"Type\":2\n            },\n            {\n                \"Account\":\"MAN.EXnVsEqjyPLHZySL9y53WgXjiFmN\",\n                \"Stock\":1,\n                \"Type\":2\n            },\n            {\n                \"Account\":\"MAN.2QR75feL9KBfaezJwhuM2VCPpqkyT\",\n                \"Stock\":1,\n                \"Type\":2\n            },\n            {\n                \"Account\":\"MAN.95Tro9wLULb6rNWNCT6QDwVBiDds\",\n                \"Stock\":1,\n                \"Type\":2\n            },\n            {\n                \"Account\":\"MAN.375qsgtLc25bJv2Cf9ffnEZPDhyvd\",\n                \"Stock\":1,\n                \"Type\":2\n            },\n            {\n                \"Account\":\"MAN.2RwBWjBykMiGRu7STzYdNzXUMyh8z\",\n                \"Stock\":1,\n                \"Type\":2\n            },\n            {\n                \"Account\":\"MAN.2zjKitA4uydg5kSZLjtSNHzDtx6k8\",\n                \"Stock\":1,\n                \"Type\":2\n            },\n            {\n                \"Account\":\"MAN.4kaowsz37i1WRrPrkg4g8qYQHtJ7\",\n                \"Stock\":1,\n                \"Type\":2\n            },\n            {\n                \"Account\":\"MAN.3B1wx2wo5anTTMjnyWXAA4FQL5opx\",\n                \"Stock\":1,\n                \"Type\":2\n            },\n            {\n                \"Account\":\"MAN.3pm3iXgrY9SYhhc9aS6DQCp4qj66t\",\n                \"Stock\":1,\n                \"Type\":2\n            },\n            {\n                \"Account\":\"MAN.4M8Svax1v6yGitwB4E2ueBtw2TesK\",\n                \"Stock\":1,\n                \"Type\":2\n            },\n            {\n                \"Account\":\"MAN.3abRtpG81TPY8YwenowwgmJ8SuLpy\",\n                \"Stock\":1,\n                \"Type\":2\n            },\n            {\n                \"Account\":\"MAN.2pqHNWtbpKKaLU71RY6TZeaQjjQnR\",\n                \"Stock\":1,\n                \"Type\":2\n            },\n            {\n                \"Account\":\"MAN.3Wf4yzVkbou1bFzkpbJUdu5rqq1se\",\n                \"Stock\":1,\n                \"Type\":2\n            },\n            {\n                \"Account\":\"MAN.U5mNRj4q7jQzbVE4tWcjsvSXTseS\",\n                \"Stock\":1,\n                \"Type\":2\n            },\n            {\n                \"Account\":\"MAN.2ZPbpaCyuEEf1WR3C6dCCFFqnH25J\",\n                \"Stock\":1,\n                \"Type\":2\n            },\n            {\n                \"Account\":\"MAN.3ByNBjw4E7gcxD3uGKtAZYLYUD5xi\",\n                \"Stock\":1,\n                \"Type\":2\n            },\n            {\n                \"Account\":\"MAN.2tSj5kjwwaiTPt4XnHAaEWBYBo9gK\",\n                \"Stock\":1,\n                \"Type\":0\n            },\n            {\n                \"Account\":\"MAN.4ZnJrUuM2bfFmdUaivrqGio28hZwd\",\n                \"Stock\":1,\n                \"Type\":0\n            },\n            {\n                \"Account\":\"MAN.49fxdGyiWPQ3evpMCNChqvCq3qzMC\",\n                \"Stock\":1,\n                \"Type\":0\n            },\n            {\n                \"Account\":\"MAN.3Ugik7ZsLoaNgX51kCJEWz1ZjxQgW\",\n                \"Stock\":1,\n                \"Type\":0\n            },\n            {\n                \"Account\":\"MAN.kwPCJkajT2op7rVgYKDqcQu2KEQn\",\n                \"Stock\":1,\n                \"Type\":0\n            },\n            {\n                \"Account\":\"MAN.ksFr4mKPfZhm2PrFdEUSoLoDsKAZ\",\n                \"Stock\":1,\n                \"Type\":3\n            },\n            {\n                \"Account\":\"MAN.42bUyszBXL3feeDHztWMiUJCRzBRP\",\n                \"Stock\":1,\n                \"Type\":3\n            },\n            {\n                \"Account\":\"MAN.2NVAVDc7AJGNP3Ghwfv8dz59kUvjM\",\n                \"Stock\":1,\n                \"Type\":3\n            },\n            {\n                \"Account\":\"MAN.e33HPpmmZC98ADkZUXigS1nDFfaA\",\n                \"Stock\":1,\n                \"Type\":3\n            }\n        ],\n\t\t\"Foundation\": \"MAN.2zXWsDtyt7vhVADGTz2yXD6h7WJnF\",\n\t\t\"VersionSuperAccounts\": [\n\t\t\t\"MAN.4739r322TyL3xCpbbdohS8NhBgGwi\"\n\t\t],\n\t\t\"BlockSuperAccounts\": [\n\t\t\t\"MAN.4L95KmR3e8eUJvzwK2thft1eKaFYa\"\n\t\t],\n\t\t\"InnerMiners\": [\n\t\t\"MAN.3SPbc3M7bK8zCT8VbvjMGW2eCaBgY\"\n\t\t],\n\t\t\"BroadcastInterval\": {\n\t\t\t\"LastBCNumber\": 0,\n\t\t\t\"LastReelectNumber\": 0,\n\t\t\t\"BCInterval\": 100,\n\t\t\t\"BackupEnableNumber\": 0,\n\t\t\t\"BackupBCInterval\": 0\n\t\t},\n\t\t\"VIPCfg\": [\n\t\t\t\t\t{\n\t\t\t\t\"MinMoney\": 0,\n\t\t\t\t\"InterestRate\": 5,\n\t\t\t\t\"ElectUserNum\": 0,\n\t\t\t\t\"StockScale\": 1000\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"MinMoney\": 1000000,\n\t\t\t\t\"InterestRate\": 10,\n\t\t\t\t\"ElectUserNum\": 3,\n\t\t\t\t\"StockScale\": 1600\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"MinMoney\": 10000000,\n\t\t\t\t\"InterestRate\": 15,\n\t\t\t\t\"ElectUserNum\": 5,\n\t\t\t\t\"StockScale\": 2000\n\t\t\t}\n\t\t],\n        \"BlkCalcCfg\":\"1\",\n        \"TxsCalcCfg\":\"1\",\n        \"InterestCalcCfg\":\"1\",\n        \"LotteryCalcCfg\":\"1\",\n        \"SlashCalcCfg\":\"1\",\n\t\t\"BlkRewardCfg\": {\n\t\t\t\"MinerMount\": 3,\n            \"MinerAttenuationRate\":8500,\n            \"MinerAttenuationNum\":5000000,\n\t\t\t\"ValidatorMount\": 5,\n            \"ValidatorAttenuationRate\":8500,\n\t\t\t\"ValidatorAttenuationNum\": 5000000,\n\t\t\t\"RewardRate\": {\n\t\t\t\t\"MinerOutRate\": 4000,\n\t\t\t\t\"ElectedMinerRate\": 5000,\n\t\t\t\t\"FoundationMinerRate\": 1000,\n\t\t\t\t\"LeaderRate\": 4000,\n\t\t\t\t\"ElectedValidatorsRate\": 5000,\n\t\t\t\t\"FoundationValidatorRate\": 1000,\n\t\t\t\t\"OriginElectOfflineRate\": 5000,\n\t\t\t\t\"BackupRewardRate\": 5000\n\t\t\t}\n\t\t},\n\t\t\"TxsRewardCfg\": {\n\t\t\t\"MinersRate\": 0,\n\t\t\t\"ValidatorsRate\": 10000,\n\t\t\t\"RewardRate\": {\n\t\t\t\t\"MinerOutRate\": 4000,\n\t\t\t\t\"ElectedMinerRate\": 6000,\n\t\t\t\t\"FoundationMinerRate\":0,\n\t\t\t\t\"LeaderRate\": 4000,\n\t\t\t\t\"ElectedValidatorsRate\": 6000,\n\t\t\t\t\"FoundationValidatorRate\": 0,\n\t\t\t\t\"OriginElectOfflineRate\": 5000,\n\t\t\t\t\"BackupRewardRate\": 5000\n\t\t\t}\n\t\t},\n\t\t\"LotteryCfg\": {\n\t\t\t\"LotteryCalc\": \"1\",\n\t\t\t\"LotteryInfo\": [{\n\t\t\t\t\"PrizeLevel\": 0,\n\t\t\t\t\"PrizeNum\": 1,\n\t\t\t\t\"PrizeMoney\": 6\n\t\t\t}]\n\t\t},\n\t\t\"InterestCfg\": {\n            \"RewardMount\":2,\n            \"AttenuationRate\":8500,\n            \"AttenuationPeriod\":5000000,\n\t\t\t\"PayInterval\": 3600\n\t\t},\n\t\t\"LeaderCfg\": {\n\t\t\t\"ParentMiningTime\": 20,\n\t\t\t\"PosOutTime\": 20,\n\t\t\t\"ReelectOutTime\": 40,\n\t\t\t\"ReelectHandleInterval\": 3\n\t\t},\n\t\t\"SlashCfg\": {\n\t\t\t\"SlashRate\": 7500\n\t\t},\n\t\t\"EleTime\": {\n\t\t\t\"MinerGen\": 6,\n\t\t\t\"MinerNetChange\": 5,\n\t\t\t\"ValidatorGen\": 4,\n\t\t\t\"ValidatorNetChange\": 3,\n\t\t\t\"VoteBeforeTime\": 7\n\t\t},\n\t\t\"EleInfo\": {\n\t\t\t\"ValidatorNum\": 19,\n\t\t\t\"BackValidator\": 5,\n\t\t\t\"ElectPlug\": \"layerd\"\n\t\t},\n\t\t\"ElectMinerNum\": {\n\t\t\t\"MinerNum\": 21\n\t\t},\n\t\t\"ElectBlackList\": null,\n\t\t\"ElectWhiteListSwitcherCfg\":  {\n\t\t\t\"Switcher\" : false\n\t\t},\n\t\t\"ElectWhiteList\": null,\n\t\t\"BlkProduceSlashCfg\": {\n\t\t\t\"Switcher\" : true,\n\t\t\t\"LowTHR\"   : 1,\n\t\t\t\"ProhibitCycleNum\" : 2\n\t\t},\n\t\t\"BlkProduceStatus\": {\n\t\t\t\"Number\" : 0\n\t\t},\n\t\t\"BlkProduceStats\": {\n\t\t\t\"StatsList\": []\n\t\t},\n       \"BlkProduceBlackList\" : {\n\t\t\t\"BlackList\" : []\n\t\t}\n    },\n  \"config\": {\n\t\t\t\t\t\"chainID\": 1,\n\t\t\t\t\t\"byzantiumBlock\": 0,\n\t\t\t\t\t\"homesteadBlock\": 0,\n\t\t\t\t\t\"eip155Block\": 0,\n\t\t\t\"eip158Block\": 0                        \t\t\t\t             \n\t},\n  \"versionSignatures\": [ \"0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\"],\n      \"difficulty\":\"0x100\",\n    \"timestamp\":\"0x5c26f140\",\n\t\t\"version\": \"1.0.0.0\",\n  \n\t\"signatures\": [\t],\n      \"coinbase\": \"MAN.1111111111111111111cs\",\n      \"leader\":\"MAN.CrsnQSJJfGxpb2taGhChLuyZwZJo\", \n       \"gasLimit\": \"0x2FEFD8\",   \n       \"nonce\": \"0x0000000000000050\",\n       \"mixhash\": \"0x0000000000000000000000000000000000000000000000000000000000000000\",\n       \"parentHash\": \"0x0000000000000000000000000000000000000000000000000000000000000000\",\n\t     \"extraData\": \"0x0000000000000000\"\n}\n`\n\tDefaultGenesisJson = `{\n    \"nettopology\":{\n    },\n    \"alloc\":{},\n    \"mstate\":{\n\t\t\"BroadcastInterval\" :{\n\t\t\t\"LastBCNumber\" : 0,\n\t\t\t\"LastReelectNumber\" : 0,\n\t\t\t\"BCInterval\" : 100,\n\t\t\t\"BackupEnableNumber\" : 0,\n\t\t\t\"BackupBCInterval\" : 0\n\t\t},\n\t\t\"VIPCfg\": [\n\t\t\t\t\t{\n\t\t\t\t\"MinMoney\": 0,\n\t\t\t\t\"InterestRate\": 5,\n\t\t\t\t\"ElectUserNum\": 0,\n\t\t\t\t\"StockScale\": 1000\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"MinMoney\": 1000000,\n\t\t\t\t\"InterestRate\": 10,\n\t\t\t\t\"ElectUserNum\": 3,\n\t\t\t\t\"StockScale\": 1000      \n\t\t\t},\n\t\t{\n\t\t\t\t\"MinMoney\": 10000000,\n\t\t\t\t\"InterestRate\": 15,\n\t\t\t\t\"ElectUserNum\": 5,\n\t\t\t\t\"StockScale\": 1000      \n\t\t\t}\n\t\t],\n        \"BlkCalcCfg\":\"1\",\n        \"TxsCalcCfg\":\"1\",\n        \"InterestCalcCfg\":\"1\",\n        \"LotteryCalcCfg\":\"1\",\n        \"SlashCalcCfg\":\"1\",\n\t\t\"BlkRewardCfg\": {\n\t\t\t\"MinerMount\": 3,\n            \"MinerAttenuationRate\":8500,\n\t\t\t\"MinerAttenuationNum\": 5000000,\n\t\t\t\"ValidatorMount\": 5,\n            \"ValidatorAttenuationRate\":8500,\n\t\t\t\"ValidatorAttenuationNum\": 5000000,\n\t\t\t\"RewardRate\": {\n\t\t\t\t\"MinerOutRate\": 4000,\n\t\t\t\t\"ElectedMinerRate\": 5000,\n\t\t\t\t\"FoundationMinerRate\": 1000,\n\t\t\t\t\"LeaderRate\": 4000,\n\t\t\t\t\"ElectedValidatorsRate\": 5000,\n\t\t\t\t\"FoundationValidatorRate\": 1000,\n\t\t\t\t\"OriginElectOfflineRate\": 5000,\n\t\t\t\t\"BackupRewardRate\": 5000\n\t\t\t}\n\t\t},\n\t\t\"TxsRewardCfg\": {\n\t\t\t\"MinersRate\": 0,\n\t\t\t\"ValidatorsRate\": 10000,\n\t\t\t\"RewardRate\": {\n\t\t\t\t\"MinerOutRate\": 4000,\n\t\t\t\t\"ElectedMinerRate\": 6000,\n\t\t\t\t\"FoundationMinerRate\":0,\n\t\t\t\t\"LeaderRate\": 4000,\n\t\t\t\t\"ElectedValidatorsRate\": 6000,\n\t\t\t\t\"FoundationValidatorRate\": 0,\n\t\t\t\t\"OriginElectOfflineRate\": 5000,\n\t\t\t\t\"BackupRewardRate\": 5000\n\t\t\t}\n\t\t},\n\t\t\"LotteryCfg\": {\n\t\t\t\"LotteryCalc\": \"1\",\n\t\t\t\"LotteryInfo\": [{\n\t\t\t\t\"PrizeLevel\": 0,\n\t\t\t\t\"PrizeNum\": 1,\n\t\t\t\t\"PrizeMoney\": 6\n\t\t\t}]\n\t\t},\n\t\t\"InterestCfg\": {\n            \"RewardMount\":2,\n            \"AttenuationRate\":8500,\n            \"AttenuationPeriod\":5000000,\n\t\t\t\"PayInterval\": 3600\n\t\t},\n\t\t\"LeaderCfg\": {\n\t\t\t\"ParentMiningTime\": 20,\n\t\t\t\"PosOutTime\": 20,\n\t\t\t\"ReelectOutTime\": 40,\n\t\t\t\"ReelectHandleInterval\": 3\n\t\t},\n\t\t\"SlashCfg\": {\n\t\t\t\"SlashRate\": 7500\n\t\t},\n\t\t\"EleTime\": {\n\t\t\t\"MinerGen\": 6,\n\t\t\t\"MinerNetChange\": 5,\n\t\t\t\"ValidatorGen\": 4,\n\t\t\t\"ValidatorNetChange\": 3,\n\t\t\t\"VoteBeforeTime\": 7\n\t\t},\n\t\t\"EleInfo\": {\n\t\t\t\"ValidatorNum\": 19,\n\t\t\t\"BackValidator\": 5,\n\t\t\t\"ElectPlug\": \"layerd\"\n\t\t},\n\t\t\"ElectMinerNum\": {\n\t\t\t\"MinerNum\": 21\n\t\t},\n\t\t\"ElectBlackList\": null,\n\t\t\"ElectWhiteListSwitcherCfg\":  {\n\t\t\t\"Switcher\" : false\n\t\t},\n\t\t\"ElectWhiteList\": null,\n\t\t\"BlkProduceSlashCfg\": {\n\t\t\t\"Switcher\" : true,\n\t\t\t\"LowTHR\"   : 1,\n\t\t\t\"ProhibitCycleNum\" : 2\n\t\t},\n\t\t\"BlkProduceStatus\": {\n\t\t\t\"Number\" : 0\n\t\t},\n\t\t\"BlkProduceStats\": {\n\t\t\t\"StatsList\": []\n\t\t},\n       \"BlkProduceBlackList\" : {\n\t\t\t\"BlackList\" : []\n\t\t}\n    },\n\t\"Currencys\":{},\n  \"config\": {\n\t\t\t\t\t\"chainID\": 1,           \n\t\t\t\t\t\"byzantiumBlock\": 0,\n\t\t\t\t\t\"homesteadBlock\": 0,\n\t\t\t\t\t\"eip155Block\": 0,\n\t\t\t\"eip158Block\": 0                        \t\t\t\t             \n\t},\n  \"versionSignatures\": [],\n      \"difficulty\":\"0x100\",\n    \"timestamp\":\"0x5c26f140\",\n\t\"version\": \"1.0.0.0\",\n\t\"signatures\": [\t],\n      \"coinbase\": \"MAN.1111111111111111111cs\",\n    \"leader\":\"MAN.1111111111111111111cs\",      \n       \"gasLimit\": \"0x2FEFD8\",   \n    \"nonce\": \"0x00000000000000178\",            \n       \"mixHash\": \"0x0000000000000000000000000000000000000000000000000000000000000000\",\n       \"parentHash\": \"0x0000000000000000000000000000000000000000000000000000000000000000\",\n\t\"extraData\": \"0x68656c6c6f2c77656c636f6d6520746f206d617472697820776f726c6421\"  \n}\n`\n)\n```\n\n```go\nvar (\n\t// ErrKnownBlock is returned when a block to import is already known locally.\n\tErrKnownBlock = errors.New(\"block already known\")\n\n\t// ErrGasLimitReached is returned by the gas pool if the amount of gas required\n\t// by a transaction is higher than what's left in the block.\n\tErrGasLimitReached = errors.New(\"gas limit reached\")\n\n\t// ErrBlacklistedHash is returned if a block to import is on the blacklist.\n\tErrBlacklistedHash = errors.New(\"blacklisted hash\")\n\n\t// ErrNonceTooHigh is returned if the nonce of a transaction is higher than the\n\t// next one expected based on the local chain.\n\tErrNonceTooHigh = errors.New(\"nonce too high\")\n\n\tErrBlackListTx = errors.New(\"blacklist tx\")\n)\n```\n\n```go\nvar (\n\t// ErrInvalidSender is returned if the transaction contains an invalid signature.\n\tErrInvalidSender = errors.New(\"invalid sender\")\n\n\t// ErrNonceTooLow is returned if the nonce of a transaction is lower than the\n\t// one present in the local chain.\n\tErrNonceTooLow = errors.New(\"nonce too low\")\n\n\t// ErrUnderpriced is returned if a transaction's gas price is below the minimum\n\t// configured for the transaction pool.\n\tErrUnderpriced = errors.New(\"transaction underpriced\")\n\n\t// ErrKnownTransaction is returned if a transaction is known or existent.\n\tErrKnownTransaction = errors.New(\"known transaction\")\n\n\t// ErrReplaceUnderpriced is returned if a transaction is attempted to be replaced\n\t// with a different one without the required price bump.\n\tErrReplaceUnderpriced = errors.New(\"replacement transaction underpriced\")\n\n\t// ErrInsufficientFunds is returned if the total cost of executing a transaction\n\t// is higher than the balance of the user's account.\n\tErrInsufficientFunds        = errors.New(\"insufficient funds for gas * price + value\")\n\tErrEntrustInsufficientFunds = errors.New(\"entrust insufficient funds for gas * price\")\n\n\t// ErrIntrinsicGas is returned if the transaction is specified to use less gas\n\t// than required to start the invocation.\n\tErrIntrinsicGas = errors.New(\"intrinsic gas too low\")\n\n\t// ErrGasLimit is returned if a transaction's requested gas limit exceeds the\n\t// maximum allowance of the current block.\n\tErrGasLimit = errors.New(\"exceeds block gas limit\")\n\n\t// ErrNegativeValue is a sanity error to ensure noone is able to specify a\n\t// transaction with a negative value.\n\tErrNegativeValue = errors.New(\"negative value\")\n\n\t// ErrOversizedData is returned if the input data of a transaction is greater\n\t// than some meaningful limit a user might use. This is not a consensus error\n\t// making the transaction invalid, rather a DOS protection.\n\tErrOversizedData = errors.New(\"oversized data\")\n\n\t//\n\tErrTXCountOverflow = errors.New(\"transaction quantity spillover\")\n\tErrTXToNil         = errors.New(\"transaction`s to(common.address) is nil\")\n\tErrTXUnknownType   = errors.New(\"Unknown extra txtype\")\n\tErrTxToRepeat      = errors.New(\"contains duplicate transfer accounts\")\n\tErrTXWrongful      = errors.New(\"transaction is unlawful\")\n\tErrTXPoolFull      = errors.New(\"txpool is full\")\n\tErrTXNonceSame     = errors.New(\"the same Nonce transaction exists\")\n\tErrRepeatEntrust   = errors.New(\"Repeat Entrust\")\n\tErrWithoutAuth     = errors.New(\"gas entrust not set \")\n\tErrinterestAmont   = errors.New(\"Incorrect total interest\")\n)\n```\n\n```go\nvar (\n\tErrTxPoolAlreadyExist = errors.New(\"txpool already exist\")\n\tErrTxPoolIsNil        = errors.New(\"txpool is nil\")\n\tErrTxPoolNonexistent  = errors.New(\"txpool nonexistent\")\n)\n```\n\n```go\nvar BadHashes = map[common.Hash]bool{\n\tcommon.HexToHash(\"05bef30ef572270f654746da22639a7a0c97dd97a7050b9e252391996aaeb689\"): true,\n\tcommon.HexToHash(\"7d05d08cbc596a2e5e4f13b80a743e53e09221b5323c3a61946b20873e58583f\"): true,\n}\n```\nBadHashes represent a set of manually tracked bad hashes (usually hard forks)\n\n```go\nvar DefaultTxPoolConfig = TxPoolConfig{\n\tPriceLimit:   params.TxGasPrice,\n\tAccountSlots: 16,\n\tGlobalSlots:  4096 * 5 * 5 * 10,\n\tAccountQueue: 64 * 1000,\n\tGlobalQueue:  1024 * 60,\n\t// contains filtered or unexported fields\n}\n```\nDefaultTxPoolConfig contains the default configurations for the transaction pool.\n\n## Functions\n\n```go\nfunc ApplyMessage(evm *vm.EVM, tx txinterface.Message, gp *GasPool) ([]byte, uint64, bool, []uint, error)\n```\nApplyMessage computes the new state by applying the given message against the old state within the environment.\n\nApplyMessage returns the bytes returned by any EVM execution (if it took place), the gas used (which includes gas refunds) and an error if it failed. An error always indicates a core error meaning that the message would always fail for that particular state and would never be accepted within a block.\n\n```go\nfunc ApplyTransaction(config *params.ChainConfig, bc ChainContext, author *common.Address, gp *GasPool, statedb *state.StateDBManage, header *types.Header, tx types.SelfTransaction, usedGas *uint64, cfg vm.Config) (*types.Receipt, uint64, []uint, error)\n```\nApplyTransaction attempts to apply a transaction to the given state database and uses the input parameters for its environment. It returns the receipt for the transaction, gas used and an error if the transaction failed, indicating the block was invalid.\n\n```go\nfunc BlackListFilter(tx types.SelfTransaction, state *state.StateDBManage, h *big.Int) bool\n```\n\n```go\nfunc CalcGasLimit(parent *types.Block) uint64\n```\nCalcGasLimit computes the gas limit of the next block after parent. This is miner strategy, not consensus protocol.\n\n```go\nfunc CanTransfer(db vm.StateDBManager, addr common.Address, amount *big.Int, typ string) bool\n```\nCanTransfer checks wether there are enough funds in the address' account to make a transfer. This does not take the necessary gas in to account to make the transfer valid.\n\n```go\nfunc CopyAddressSlice(Src *[]GenesisAddress) []common.Address\n```\n\n```go\nfunc GenerateChain(config *params.ChainConfig, parent *types.Block, engine consensus.Engine, db mandb.Database, n int, gen func(int, *BlockGen)) ([]*types.Block, []types.Receipts)\n```\nGenerateChain creates a chain of n blocks. The first block's parent will be the provided parent. db is used to store intermediate states and should contain the parent's state trie.\n\nThe generator function is called with a new block generator for every block. Any transactions and uncles added to the generator become part of the block. If gen is nil, the blocks will be empty and their coinbase will be the zero address.\n\nBlocks created by GenerateChain do not contain valid proof of work values. Inserting them into BlockChain requires use of FakePow or a similar non-validating proof of work implementation.\n\n```go\nfunc GenesisBlockForTesting(db mandb.Database, addr common.Address, balance *big.Int) *types.Block\n```\nGenesisBlockForTesting creates and writes a block in which addr has the given wei balance.\n\n```go\nfunc GetBroadcastTxMap(bc ChainReader, root []common.CoinRoot, txtype string) (reqVal map[common.Address][]byte, err error)\n```\n\n```go\nfunc GetHashFn(ref *types.Header, chain ChainContext) func(n uint64) common.Hash\n```\nY ====================================end================================ GetHashFn returns a GetHashFunc which retrieves header hashes by number\n\n```go\nfunc GetMatrixCoin(state *state.StateDBManage) ([]string, error)\n```\n\n```go\nfunc IntrinsicGas(data []byte) (uint64, error)\n```\nIntrinsicGas computes the 'intrinsic gas' for a message with the given data. func IntrinsicGas(data \\[]byte, contractCreation, homestead bool) (uint64, error) {\n\n```go\nfunc NewBlackListMaintainA(list []mc.UserBlockProduceSlash) *blacklistMaintain\n```\n\n```go\nfunc NewBlackListMaintainB(parentHash common.Hash, list []mc.UserBlockProduceSlash) *blacklistMaintain\n```\n\n```go\nfunc NewEVMContext(sender common.Address, gasprice *big.Int, header *types.Header, chain ChainContext, author *common.Address) vm.Context\n```\n\n```go\nfunc ProduceBroadcastIntervalData(block *types.Block, state *state.StateDBManage, readFn PreStateReadFn) (interface{}, error)\n```\n\n```go\nfunc ProduceMatrixStateData(block *types.Block, stateDb *state.StateDBManage, readFn PreStateReadFn) (interface{}, error)\n```\n\n```go\nfunc SetReceiptsData(config *params.ChainConfig, block *types.Block) error\n```\nSetReceiptsData computes all the non-consensus fields of the receipts\n\n```go\nfunc SetupGenesisBlock(db mandb.Database, genesis *Genesis) (*params.ChainConfig, common.Hash, error)\n```\nSetupGenesisBlock writes or updates the genesis block in db. The block that will be used is:\n\n\t                     genesis == nil       genesis != nil\n\t                  +------------------------------------------\n\tdb has no genesis |  main-net default  |  genesis\n\tdb has genesis    |  from DB           |  genesis (if compatible)\n\nThe stored chain configuration will be updated if it is compatible (i.e. does not specify a fork block below the local head block). In case of a conflict, the error is a \\*params.ConfigCompatError and the new, unwritten config is returned.\n\nThe returned chain configuration is never nil.\n\n```go\nfunc TransToCommonElect(elect GenesisElect) common.Elect\n```\n\n```go\nfunc TransToCommonNetTopology(gtopology GenesisNetTopology) common.NetTopology\n```\n\n```go\nfunc Transfer(db vm.StateDBManager, sender, recipient common.Address, amount *big.Int, typ string)\n```\nTransfer subtracts amount from sender and adds amount to recipient using the given Db\n\n## Types\n\n```go\ntype BadBlockArgs struct {\n\tHash   common.Hash   `json:\"hash\"`\n\tHeader *types.Header `json:\"header\"`\n}\n```\nBadBlockArgs represents the entries in the list returned when bad blocks are queried.\n\n```go\ntype Blacklist struct {\n\tBmap map[common.Address]bool\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nvar SelfBlackList *Blacklist\n```\n\n```go\nfunc NewInitblacklist() *Blacklist\n```\n\n```go\nfunc (b *Blacklist) AddBlackAddress(addr common.Address)\n```\n\n```go\nfunc (b *Blacklist) FindBlackAddress(addr common.Address) bool\n```\n\n```go\ntype BlockChain struct {\n\t// contains filtered or unexported fields\n}\n```\nBlockChain represents the canonical chain given a database with a genesis block. The Blockchain manages chain imports, reverts, chain reorganisations.\n\nImporting blocks in to the block chain happens according to the set of rules defined by the two stage Validator. Processing of blocks is done using the Processor which processes the included transaction. The validation of the state is done in the second part of the Validator. Failing results in aborting of the import.\n\nThe BlockChain also helps in returning blocks from \\*\\*any\\*\\* chain included in the database as well as blocks that represents the canonical chain. It's important to note that GetBlock can return any block and does not need to be included in the canonical one where as GetBlockByNumber always represents the canonical chain.\n\n```go\nfunc NewBlockChain(db mandb.Database, cacheConfig *CacheConfig, chainConfig *params.ChainConfig, engine consensus.Engine, vmConfig vm.Config) (*BlockChain, error)\n```\nNewBlockChain returns a fully initialised block chain using information available in the database. It initialises the default Matrix Validator and Processor.\n\n```go\nfunc NewCanonical(engine consensus.Engine, n int, full bool) (mandb.Database, *BlockChain, error)\n```\nnewCanonical creates a chain database, and injects a deterministic canonical chain. Depending on the full flag, if creates either a full block chain or a header only chain.\n\n```go\nfunc (bc *BlockChain) BadBlocks() ([]BadBlockArgs, error)\n```\nBadBlocks returns a list of the last 'bad blocks' that the client has seen on the network\n\n```go\nfunc (bc *BlockChain) Config() *params.ChainConfig\n```\nConfig retrieves the blockchain's chain configuration.\n\n```go\nfunc (bc *BlockChain) CurrentBlock() *types.Block\n```\nCurrentBlock retrieves the current head block of the canonical chain. The block is retrieved from the blockchain's internal cache.\n\n```go\nfunc (bc *BlockChain) CurrentBlockStore(tbc *types.Block)\n```\n\n```go\nfunc (bc *BlockChain) CurrentFastBlock() *types.Block\n```\nCurrentFastBlock retrieves the current fast-sync head block of the canonical chain. The block is retrieved from the blockchain's internal cache.\n\n```go\nfunc (bc *BlockChain) CurrentHeader() *types.Header\n```\nCurrentHeader retrieves the current head header of the canonical chain. The header is retrieved from the HeaderChain's internal cache.\n\n```go\nfunc (bc *BlockChain) DPOSEngine(version []byte) consensus.DPOSEngine\n```\n\n```go\nfunc (bc *BlockChain) DelLocalBlocks(blocks []*mc.BlockInfo) (fails []*mc.BlockInfo, err error)\n```\n\n```go\nfunc (bc *BlockChain) Engine(version []byte) consensus.Engine\n```\nEngine retrieves the blockchain's consensus engine.\n\n```go\nfunc (bc *BlockChain) Export(w io.Writer) error\n```\nExport writes the active chain to the given writer.\n\n```go\nfunc (bc *BlockChain) ExportN(w io.Writer, first uint64, last uint64) error\n```\nExportN writes a subset of the active chain to the given writer.\n\n```go\nfunc (bc *BlockChain) FastSyncCommitHead(hash common.Hash) error\n```\nFastSyncCommitHead sets the current head block to the one defined by the hash irrelevant what the chain contents were prior.\n\n```go\nfunc (bc *BlockChain) GasLimit() uint64\n```\nGasLimit returns the gas limit of the current HEAD block.\n\n```go\nfunc (bc *BlockChain) Genesis() *types.Block\n```\nGenesis retrieves the chain's genesis block.\n\n```go\nfunc (bc *BlockChain) GetA0AccountFromA1Account(a1Account common.Address, block *types.Block, st *state.StateDBManage) (common.Address, error)\n```\n根据A1账户得到A0账户\n\n```go\nfunc (bc *BlockChain) GetA0AccountFromAnyAccount(account common.Address, blockHash common.Hash) (common.Address, common.Address, error)\n```\n根据任意账户得到A0和A1账户\n\n```go\nfunc (bc *BlockChain) GetA0AccountFromAnyAccountAtSignHeight(account common.Address, blockHash common.Hash, signHeight uint64) (common.Address, common.Address, error)\n```\n根据任意账户得到A0和A1账户\n\n```go\nfunc (bc *BlockChain) GetA1AccountFromA0Account(a0Account common.Address, block *types.Block, st *state.StateDBManage) (common.Address, error)\n```\n根据A0账户得到A1账户\n\n```go\nfunc (bc *BlockChain) GetA1AccountFromA2Account(a2Account common.Address, block *types.Block, st *state.StateDBManage) (common.Address, error)\n```\n根据A2账户得到A1账户\n\n```go\nfunc (bc *BlockChain) GetA1AccountFromA2AccountAtSignHeight(a2Account common.Address, st *state.StateDBManage, signHeight uint64) (common.Address, error)\n```\n根据A2账户得到A1账户\n\n```go\nfunc (bc *BlockChain) GetA2AccountsFromA0Account(a0Account common.Address, blockHash common.Hash) ([]common.Address, error)\n```\n//根据A2账户得到A0账户\n\n\tfunc (bc *BlockChain) GetA0AccountFromA2Account(a2Account common.Address, blockHash common.Hash) (common.Address, error) {\n\t\ta1Account, err := bc.GetA1AccountFromA2Account(a2Account, blockHash)\n\t\tif err != nil {\n\t\t\treturn common.Address{}, err\n\t\t}\n\t\ta0Account, err := bc.GetA0AccountFromA1Account(a1Account, blockHash)\n\t\tif err != nil {\n\t\t\treturn common.Address{}, err\n\t\t}\n\t\treturn a0Account, nil\n\t}\n\n根据A0账户得到A2账户集合\n\n```go\nfunc (bc *BlockChain) GetA2AccountsFromA0AccountAtSignHeight(a0Account common.Address, blockHash common.Hash, signHeight uint64) ([]common.Address, error)\n```\n根据A0账户得到A2账户集合\n\n```go\nfunc (bc *BlockChain) GetA2AccountsFromA1Account(a1Account common.Address, block *types.Block, st *state.StateDBManage) ([]common.Address, error)\n```\n根据A1账户得到A2账户集合\n\n```go\nfunc (bc *BlockChain) GetA2AccountsFromA1AccountAtSignHeight(a1Account common.Address, block *types.Block, st *state.StateDBManage, signHeight uint64) ([]common.Address, error)\n```\n\n```go\nfunc (bc *BlockChain) GetAncestorHash(sonHash common.Hash, ancestorNumber uint64) (common.Hash, error)\n```\n\n```go\nfunc (bc *BlockChain) GetBlackList(state *state.StateDBManage) *mc.BlockProduceSlashBlackList\n```\n\n```go\nfunc (bc *BlockChain) GetBlock(hash common.Hash, number uint64) *types.Block\n```\nGetBlock retrieves a block from the database by hash and number, caching it if found.\n\n```go\nfunc (bc *BlockChain) GetBlockByHash(hash common.Hash) *types.Block\n```\nGetBlockByHash retrieves a block from the database by hash, caching it if found.\n\n```go\nfunc (bc *BlockChain) GetBlockByNumber(number uint64) *types.Block\n```\nGetBlockByNumber retrieves a block from the database by number, caching it (associated with its hash) if found.\n\n```go\nfunc (bc *BlockChain) GetBlockHashesFromHash(hash common.Hash, max uint64) []common.Hash\n```\nGetBlockHashesFromHash retrieves a number of block hashes starting at a given hash, fetching towards the genesis block.\n\n```go\nfunc (bc *BlockChain) GetBlockSuperAccounts(blockHash common.Hash) ([]common.Address, error)\n```\n\n```go\nfunc (bc *BlockChain) GetBlockSuperBlockInfo(blockHash common.Hash) (uint64, uint64, error)\n```\n\n```go\nfunc (bc *BlockChain) GetBlocksFromHash(hash common.Hash, n int) (blocks []*types.Block)\n```\nGetBlocksFromHash returns the block corresponding to hash and up to n-1 ancestors. \\[deprecated by man/62]\n\n```go\nfunc (bc *BlockChain) GetBody(hash common.Hash) *types.Body\n```\nGetBody retrieves a block body (transactions and uncles) from the database by hash, caching it if found.\n\n```go\nfunc (bc *BlockChain) GetBodyRLP(hash common.Hash) rlp.RawValue\n```\nGetBodyRLP retrieves a block body in RLP encoding from the database by hash, caching it if found.\n\n```go\nfunc (bc *BlockChain) GetBroadcastAccounts(blockHash common.Hash) ([]common.Address, error)\n```\n\n```go\nfunc (bc *BlockChain) GetBroadcastInterval() (*mc.BCIntervalInfo, error)\n```\n\n```go\nfunc (bc *BlockChain) GetBroadcastIntervalByHash(blockHash common.Hash) (*mc.BCIntervalInfo, error)\n```\n\n```go\nfunc (bc *BlockChain) GetBroadcastIntervalByNumber(number uint64) (*mc.BCIntervalInfo, error)\n```\n\n```go\nfunc (bc *BlockChain) GetCurrentHash() common.Hash\n```\n\n```go\nfunc (bc *BlockChain) GetDB() mandb.Database\n```\n\n```go\nfunc (bc *BlockChain) GetGraphByHash(hash common.Hash) (*mc.TopologyGraph, *mc.ElectGraph, error)\n```\n\n```go\nfunc (bc *BlockChain) GetGraphByState(state matrixstate.StateDB) (*mc.TopologyGraph, *mc.ElectGraph, error)\n```\n\n```go\nfunc (bc *BlockChain) GetHashByNumber(number uint64) common.Hash\n```\n\n```go\nfunc (bc *BlockChain) GetHeader(hash common.Hash, number uint64) *types.Header\n```\nGetHeader retrieves a block header from the database by hash and number, caching it if found.\n\n```go\nfunc (bc *BlockChain) GetHeaderByHash(hash common.Hash) *types.Header\n```\nGetHeaderByHash retrieves a block header from the database by hash, caching it if found.\n\n```go\nfunc (bc *BlockChain) GetHeaderByNumber(number uint64) *types.Header\n```\nGetHeaderByNumber retrieves a block header from the database by number, caching it (associated with its hash) if found.\n\n```go\nfunc (bc *BlockChain) GetInnerMinerAccounts(blockHash common.Hash) ([]common.Address, error)\n```\n\n```go\nfunc (bc *BlockChain) GetIpfsQMux()\n```\n\n```go\nfunc (bc *BlockChain) GetIpfsQUnMux()\n```\n\n```go\nfunc (bc *BlockChain) GetMultiCoinSuperAccounts(blockHash common.Hash) ([]common.Address, error)\n```\n\n```go\nfunc (bc *BlockChain) GetReceiptsByHash(hash common.Hash) []types.CoinReceipts\n```\nGetReceiptsByHash retrieves the receipts for all transactions in a given block.\n\n```go\nfunc (bc *BlockChain) GetSignAccountPassword(signAccounts []common.Address) (common.Address, string, error)\n```\n\n```go\nfunc (bc *BlockChain) GetSlashCfg(state *state.StateDBManage) (*mc.BlockProduceSlashCfg, error)\n```\n\n```go\nfunc (bc *BlockChain) GetStateCache() state.Database\n```\n\n```go\nfunc (bc *BlockChain) GetStoreBlockInfo() *prque.Prque\n```\n\n```go\nfunc (bc *BlockChain) GetSubChainSuperAccounts(blockHash common.Hash) ([]common.Address, error)\n```\n\n```go\nfunc (bc *BlockChain) GetSuperBlockInfo() (*mc.SuperBlkCfg, error)\n```\n\n```go\nfunc (bc *BlockChain) GetSuperBlockNum() (uint64, error)\n```\n\n```go\nfunc (bc *BlockChain) GetSuperBlockSeq() (uint64, error)\n```\n\n```go\nfunc (bc *BlockChain) GetTd(hash common.Hash, number uint64) *big.Int\n```\nGetTd retrieves a block's total difficulty in the canonical chain from the database by hash and number, caching it if found.\n\n```go\nfunc (bc *BlockChain) GetTdByHash(hash common.Hash) *big.Int\n```\nGetTdByHash retrieves a block's total difficulty in the canonical chain from the database by hash, caching it if found.\n\n```go\nfunc (bc *BlockChain) GetTopologyStore() *TopologyStore\n```\n\n```go\nfunc (bc *BlockChain) GetUnclesInChain(block *types.Block, length int) []*types.Header\n```\nGetUnclesInChain retrieves all the uncles from a given block backwards until a specific distance is reached.\n\n```go\nfunc (bc *BlockChain) GetVersionSuperAccounts(blockHash common.Hash) ([]common.Address, error)\n```\n\n```go\nfunc (bc *BlockChain) HandleUpTimeWithSuperBlock(state *state.StateDBManage, accounts []common.Address, blockNum uint64, bcInterval *mc.BCIntervalInfo) (map[common.Address]uint64, error)\n```\n\n```go\nfunc (bc *BlockChain) HasBlock(hash common.Hash, number uint64) bool\n```\nHasBlock checks if a block is fully present in the database or not.\n\n```go\nfunc (bc *BlockChain) HasBlockAndState(hash common.Hash, number uint64) bool\n```\nHasBlockAndState checks if a block and associated state trie is fully present in the database or not, caching it if present.\n\n```go\nfunc (bc *BlockChain) HasHeader(hash common.Hash, number uint64) bool\n```\nHasHeader checks if a block header is present in the database or not, caching it if present.\n\n```go\nfunc (bc *BlockChain) HasState(hash common.Hash) bool\n```\nHasState checks if state trie is fully present in the database or not.\n\n```go\nfunc (bc *BlockChain) HasStateRoot(roots []common.CoinRoot) bool\n```\n\n```go\nfunc (bc *BlockChain) InsertChain(chain types.Blocks, flg int) (int, error)\n```\nInsertChain attempts to insert the given batch of blocks in to the canonical chain or, otherwise, create a fork. If an error is returned it will return the index number of the failing block as well an error describing what went wrong.\n\nAfter insertion is done, all accumulated events will be fired.\n\n```go\nfunc (bc *BlockChain) InsertChainNotify(chain types.Blocks, notify bool) (int, error)\n```\n\n```go\nfunc (bc *BlockChain) InsertHeaderChain(chain []*types.Header, checkFreq int) (int, error)\n```\nInsertHeaderChain attempts to insert the given header chain in to the local chain, possibly creating a reorg. If an error is returned, it will return the index number of the failing header as well an error describing what went wrong.\n\nThe verify parameter can be used to fine tune whether nonce verification should be done or not. The reason behind the optional check is because some of the header retrieval mechanisms already need to verify nonces, as well as because nonces can be verified sparsely, not needing to check each.\n\n```go\nfunc (bc *BlockChain) InsertReceiptChain(blockChain types.Blocks) (int, error)\n```\nInsertReceiptChain attempts to complete an already existing header chain with transaction and receipt data.\n\n```go\nfunc (bc *BlockChain) InsertSuperBlock(superBlockGen *Genesis, notify bool) (*types.Block, error)\n```\n\n```go\nfunc (bc *BlockChain) LoadDumps(dumps []state.DumpDB, number int64) bool\n```\n\n```go\nfunc (bc *BlockChain) PostChainEvents(events []interface{}, logs []types.CoinLogs)\n```\nPostChainEvents iterates over the events generated by a chain insertion and posts them into the event feed. TODO: Should not expose PostChainEvents. The chain events should be posted in WriteBlock.\n\n```go\nfunc (bc *BlockChain) PrintSnapshotAccountMsg(blockNum uint64, hash string, filePath string)\n```\n\n```go\nfunc (bc *BlockChain) ProcessBlockGProduceSlash(version string, state *state.StateDBManage, header *types.Header) error\n```\n\n```go\nfunc (bc *BlockChain) ProcessMatrixState(block *types.Block, preVersion string, state *state.StateDBManage) error\n```\n\n```go\nfunc (bc *BlockChain) ProcessStateVersion(version []byte, st *state.StateDBManage) error\n```\n\n```go\nfunc (bc *BlockChain) ProcessStateVersionSwitch(num uint64, t uint64, stateDB *state.StateDBManage) error\n```\n\n```go\nfunc (bc *BlockChain) ProcessUpTime(state *state.StateDBManage, header *types.Header) (map[common.Address]uint64, error)\n```\n\n```go\nfunc (bc *BlockChain) Processor(version []byte) Processor\n```\nProcessor returns the current processor.\n\n```go\nfunc (bc *BlockChain) RegisterMatrixStateDataProducer(key string, producer ProduceMatrixStateDataFn)\n```\n\n```go\nfunc (bc *BlockChain) Reset() error\n```\nReset purges the entire blockchain, restoring it to its genesis state.\n\n```go\nfunc (bc *BlockChain) ResetWithGenesisBlock(genesis *types.Block) error\n```\nResetWithGenesisBlock purges the entire blockchain, restoring it to the specified genesis state.\n\n```go\nfunc (bc *BlockChain) Rollback(chain []common.Hash)\n```\nRollback is designed to remove a chain of links from the database that aren't certain enough to be valid.\n\n```go\nfunc (bc *BlockChain) SaveSnapshot(blockNum uint64, period uint64, NewBlocknum uint64)\n```\n\n```go\nfunc (bc *BlockChain) SetDposEngine(version string, dposEngine consensus.DPOSEngine)\n```\n\n```go\nfunc (bc *BlockChain) SetHead(head uint64) error\n```\nSetHead rewinds the local chain to a new head. In the case of headers, everything above the new head will be deleted and the new one set. In the case of blocks though, the head may be further rewound if block bodies are missing (non-archive nodes after a fast sync).\n\n```go\nfunc (bc *BlockChain) SetProcessor(version string, processor Processor)\n```\nSetProcessor sets the processor required for making state modifications.\n\n```go\nfunc (bc *BlockChain) SetSnapshotParam(period uint64, start uint64)\n```\n\n```go\nfunc (bc *BlockChain) SetValidator(version string, validator Validator)\n```\nSetValidator sets the validator which is used to validate incoming blocks.\n\n```go\nfunc (bc *BlockChain) SetbSendIpfsFlg(flg bool)\n```\nlb ipfs\n\n```go\nfunc (bc *BlockChain) State() (*state.StateDBManage, error)\n```\nState returns a new mutable state based on the current HEAD block.\n\n```go\nfunc (bc *BlockChain) StateAt(root []common.CoinRoot) (*state.StateDBManage, error)\n```\nStateAt returns a new mutable state based on a particular point in time.\n\n```go\nfunc (bc *BlockChain) StateAtBlockHash(hash common.Hash) (*state.StateDBManage, error)\n```\n\n```go\nfunc (bc *BlockChain) StateAtNumber(number uint64) (*state.StateDBManage, error)\n```\n\n```go\nfunc (bc *BlockChain) Stop()\n```\nStop stops the blockchain service. If any imports are currently in progress it will abort them using the procInterrupt.\n\n```go\nfunc (bc *BlockChain) SubscribeChainEvent(ch chan\u003c- ChainEvent) event.Subscription\n```\nSubscribeChainEvent registers a subscription of ChainEvent.\n\n```go\nfunc (bc *BlockChain) SubscribeChainHeadEvent(ch chan\u003c- ChainHeadEvent) event.Subscription\n```\nSubscribeChainHeadEvent registers a subscription of ChainHeadEvent.\n\n```go\nfunc (bc *BlockChain) SubscribeChainSideEvent(ch chan\u003c- ChainSideEvent) event.Subscription\n```\nSubscribeChainSideEvent registers a subscription of ChainSideEvent.\n\n```go\nfunc (bc *BlockChain) SubscribeLogsEvent(ch chan\u003c- []types.CoinLogs) event.Subscription\n```\nSubscribeLogsEvent registers a subscription of \\[]\\*types.Log.\n\n```go\nfunc (bc *BlockChain) SubscribeRemovedLogsEvent(ch chan\u003c- RemovedLogsEvent) event.Subscription\n```\nSubscribeRemovedLogsEvent registers a subscription of RemovedLogsEvent.\n\n```go\nfunc (bc *BlockChain) SynSnapshot(blockNum uint64, hash string, filePath string) (uint64, bool)\n```\n\n```go\nfunc (bc *BlockChain) TrieNode(hash common.Hash) ([]byte, error)\n```\nTrieNode retrieves a blob of data associated with a trie node (or code hash) either from ephemeral in-memory cache, or from persistent storage.\n\n```go\nfunc (bc *BlockChain) Validator(version []byte) Validator\n```\nValidator returns the current validator.\n\n```go\nfunc (bc *BlockChain) VerifyHeader(header *types.Header) error\n```\n\n```go\nfunc (bc *BlockChain) WriteBlockWithState(block *types.Block, state *state.StateDBManage) (status WriteStatus, err error)\n```\nWriteBlockWithState writes the block and all associated state to the database.\n\n```go\nfunc (bc *BlockChain) WriteBlockWithoutState(block *types.Block, td *big.Int) (err error)\n```\nWriteBlockWithoutState writes only the block and its metadata to the database, but does not write any state. This is used to construct competing side forks up to the point where they exceed the canonical total difficulty.\n\n```go\ntype BlockGen struct {\n\t// contains filtered or unexported fields\n}\n```\nBlockGen creates blocks for testing. See GenerateChain for a detailed explanation.\n\n```go\nfunc (b *BlockGen) AddTx(tx *types.Transaction)\n```\nAddTx adds a transaction to the generated block. If no coinbase has been set, the block's coinbase is set to the zero address.\n\nAddTx panics if the transaction cannot be executed. In addition to the protocol-imposed limitations (gas limit, etc.), there are some further limitations on the content of transactions that can be added. Notably, contract code relying on the BLOCKHASH instruction will panic during execution.\n\n```go\nfunc (b *BlockGen) AddTxWithChain(bc *BlockChain, tx *types.Transaction)\n```\nAddTxWithChain adds a transaction to the generated block. If no coinbase has been set, the block's coinbase is set to the zero address.\n\nAddTxWithChain panics if the transaction cannot be executed. In addition to the protocol-imposed limitations (gas limit, etc.), there are some further limitations on the content of transactions that can be added. If contract code relies on the BLOCKHASH instruction, the block in chain will be returned.\n\n```go\nfunc (b *BlockGen) AddUncheckedReceipt(receipt *types.Receipt)\n```\nAddUncheckedReceipt forcefully adds a receipts to the block without a backing transaction.\n\nAddUncheckedReceipt will cause consensus failures when used during real chain processing. This is best used in conjunction with raw block insertion.\n\n```go\nfunc (b *BlockGen) AddUncle(h *types.Header)\n```\nAddUncle adds an uncle header to the generated block.\n\n```go\nfunc (b *BlockGen) Number() *big.Int\n```\nNumber returns the block number of the block being generated.\n\n```go\nfunc (b *BlockGen) OffsetTime(seconds int64)\n```\nOffsetTime modifies the time instance of a block, implicitly changing its associated difficulty. It's useful to test scenarios where forking is not tied to chain length directly.\n\n```go\nfunc (b *BlockGen) PrevBlock(index int) *types.Block\n```\nPrevBlock returns a previously generated block by number. It panics if num is greater or equal to the number of the block being generated. For index -1, PrevBlock returns the parent block given to GenerateChain.\n\n```go\nfunc (b *BlockGen) SetCoinbase(addr common.Address)\n```\nSetCoinbase sets the coinbase of the generated block. It can be called at most once.\n\n```go\nfunc (b *BlockGen) SetExtra(data []byte)\n```\nSetExtra sets the extra data field of the generated block.\n\n```go\nfunc (b *BlockGen) TxNonce(addr common.Address) uint64\n```\nTxNonce returns the next valid transaction nonce for the account at addr. It panics if the account does not exist.\n\n```go\ntype BlockValidator struct {\n\t// contains filtered or unexported fields\n}\n```\nBlockValidator is responsible for validating block headers, uncles and processed state.\n\nBlockValidator implements Validator.\n\n```go\nfunc NewBlockValidator(config *params.ChainConfig, blockchain *BlockChain, engine consensus.Engine) *BlockValidator\n```\nNewBlockValidator returns a new block validator which is safe for re-use\n\n```go\nfunc (v *BlockValidator) ValidateBody(block *types.Block) error\n```\n\n```go\nfunc (v *BlockValidator) ValidateHeader(header *types.Header) error\n```\nValidateBody validates the given block's uncles and verifies the the block header's transaction and uncle roots. The headers are assumed to be already validated at this point.\n\n```go\nfunc (v *BlockValidator) ValidateState(block, parent *types.Block, statedb *state.StateDBManage, usedGas uint64) error\n```\nValidateState validates the various changes that happen after a state transition, such as amount of used gas, the receipt roots and the state root itself. ValidateState returns a database batch if the validation was a success otherwise nil and an error is returned.\n\n```go\ntype BroadCastTxPool struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewBroadTxPool(chainconfig *params.ChainConfig, chain blockChainBroadCast, path string) *BroadCastTxPool\n```\n\n```go\nfunc (bPool *BroadCastTxPool) AddTxPool(tx types.SelfTransaction) (reerr error)\n```\nAddTxPool\n\n```go\nfunc (bPool *BroadCastTxPool) GetAllSpecialTxs() map[common.Address][]types.SelfTransaction\n```\nGetAllSpecialTxs get BroadCast transaction. (use apply SelfTransaction)\n\n```go\nfunc (bPool *BroadCastTxPool) Pending() (map[string]map[common.Address]types.SelfTransactions, error)\n```\nPending\n\n```go\nfunc (bPool *BroadCastTxPool) ProcessMsg(m NetworkMsgData)\n```\nProcessMsg\n\n```go\nfunc (bPool *BroadCastTxPool) ReturnAllTxsByN(listN []uint32, resqe byte, addr common.Address, retch chan *RetChan_txpool)\n```\n\n```go\nfunc (bPool *BroadCastTxPool) SendMsg(data MsgStruct)\n```\nSendMsg\n\n```go\nfunc (bPool *BroadCastTxPool) Stop()\n```\nStop terminates the transaction pool.\n\n```go\nfunc (bPool *BroadCastTxPool) Type() byte\n```\nType return txpool type.\n\n```go\ntype CacheConfig struct {\n\tDisabled      bool          // Whether to disable trie write caching (archive node)\n\tTrieNodeLimit int           // Memory limit (MB) at which to flush the current in-memory trie to disk\n\tTrieTimeLimit time.Duration // Time limit after which to flush the current in-memory trie to disk\n}\n```\nCacheConfig contains the configuration values for the trie caching/pruning that's resident in a blockchain.\n\n```go\ntype ChainContext interface {\n\t// Engine retrieves the chain's consensus engine.\n\tEngine(version []byte) consensus.Engine\n\n\t// GetHeader returns the hash corresponding to their hash.\n\tGetHeader(common.Hash, uint64) *types.Header\n}\n```\nChainContext supports retrieving headers and consensus parameters from the current blockchain to be used during transaction processing.\n\n```go\ntype ChainEvent struct {\n\tBlock *types.Block\n\tHash  common.Hash\n\tLogs  []types.CoinLogs\n}\n```\n\n```go\ntype ChainHeadEvent struct{ Block *types.Block }\n```\n\n```go\ntype ChainIndexer struct {\n\t// contains filtered or unexported fields\n}\n```\nChainIndexer does a post-processing job for equally sized sections of the canonical chain (like BlooomBits and CHT structures). A ChainIndexer is connected to the blockchain through the event system by starting a ChainEventLoop in a goroutine.\n\nFurther child ChainIndexers can be added which use the output of the parent section indexer. These child indexers receive new head notifications only after an entire section has been finished or in case of rollbacks that might affect already finished sections.\n\n```go\nfunc NewChainIndexer(chainDb, indexDb mandb.Database, backend ChainIndexerBackend, section, confirm uint64, throttling time.Duration, kind string) *ChainIndexer\n```\nNewChainIndexer creates a new chain indexer to do background processing on chain segments of a given size after certain number of confirmations passed. The throttling parameter might be used to prevent database thrashing.\n\n```go\nfunc (c *ChainIndexer) AddChildIndexer(indexer *ChainIndexer)\n```\nAddChildIndexer adds a child ChainIndexer that can use the output of this one\n\n```go\nfunc (c *ChainIndexer) AddKnownSectionHead(section uint64, shead common.Hash)\n```\nAddKnownSectionHead marks a new section head as known/processed if it is newer than the already known best section head\n\n```go\nfunc (c *ChainIndexer) Close() error\n```\nClose tears down all goroutines belonging to the indexer and returns any error that might have occurred internally.\n\n```go\nfunc (c *ChainIndexer) SectionHead(section uint64) common.Hash\n```\nSectionHead retrieves the last block hash of a processed section from the index database.\n\n```go\nfunc (c *ChainIndexer) Sections() (uint64, uint64, common.Hash)\n```\nSections returns the number of processed sections maintained by the indexer and also the information about the last header indexed for potential canonical verifications.\n\n```go\nfunc (c *ChainIndexer) Start(chain ChainIndexerChain)\n```\nStart creates a goroutine to feed chain head events into the indexer for cascading background processing. Children do not need to be started, they are notified about new events by their parents.\n\n```go\ntype ChainIndexerBackend interface {\n\t// Reset initiates the processing of a new chain segment, potentially terminating\n\t// any partially completed operations (in case of a reorg).\n\tReset(section uint64, prevHead common.Hash) error\n\n\t// Process crunches through the next header in the chain segment. The caller\n\t// will ensure a sequential order of headers.\n\tProcess(header *types.Header)\n\n\t// Commit finalizes the section metadata and stores it into the database.\n\tCommit() error\n}\n```\nChainIndexerBackend defines the methods needed to process chain segments in the background and write the segment results into the database. These can be used to create filter blooms or CHTs.\n\n```go\ntype ChainIndexerChain interface {\n\t// CurrentHeader retrieves the latest locally known header.\n\tCurrentHeader() *types.Header\n\n\t// SubscribeChainEvent subscribes to new head header notifications.\n\tSubscribeChainEvent(ch chan\u003c- ChainEvent) event.Subscription\n}\n```\nChainIndexerChain interface is used for connecting the indexer to a blockchain\n\n```go\ntype ChainReader interface {\n\tStateAt(root []common.CoinRoot) (*state.StateDBManage, error)\n}\n```\n\n```go\ntype ChainSideEvent struct {\n\tBlock *types.Block\n}\n```\n\n```go\ntype CoinPachFilter struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\ntype ConsensusNTx struct {\n\tKey   uint32\n\tValue types.SelfTransaction\n}\n```\n\n```go\ntype DeleteCallback func(common.Hash, uint64)\n```\nDeleteCallback is a callback function that is called by SetHead before each header is deleted.\n\n```go\ntype GasPool uint64\n```\nGasPool tracks the amount of gas available during execution of the transactions in a block. The zero value is a pool with zero gas available.\n\n```go\nfunc (gp *GasPool) AddGas(amount uint64) *GasPool\n```\nAddGas makes gas available for execution.\n\n```go\nfunc (gp *GasPool) Gas() uint64\n```\nGas returns the amount of gas remaining in the pool.\n\n```go\nfunc (gp *GasPool) String() string\n```\n\n```go\nfunc (gp *GasPool) SubGas(amount uint64) error\n```\nSubGas deducts the given amount from the pool if enough gas is available and returns an error otherwise.\n\n```go\ntype Genesis struct {\n\tConfig            *params.ChainConfig `json:\"config,omitempty\"`\n\tNonce             uint64              `json:\"nonce\"`\n\tTimestamp         uint64              `json:\"timestamp\"    gencodec:\"required\"`\n\tExtraData         []byte              `json:\"extraData\"`\n\tVersion           string              `json:\"version\"    gencodec:\"required\"`\n\tVersionSignatures []common.Signature  `json:\"versionSignatures\"    gencodec:\"required\"`\n\tVrfValue          []byte              `json:\"vrfvalue\"`\n\tLeader            common.Address      `json:\"leader\"`\n\tNextElect         []common.Elect      `json:\"nextElect\"    gencodec:\"required\"`\n\tNetTopology       common.NetTopology  `json:\"nettopology\"       gencodec:\"required\"`\n\tSignatures        []common.Signature  `json:\"signatures\" gencodec:\"required\"`\n\n\tGasLimit   uint64         `json:\"gasLimit\"   gencodec:\"required\"`\n\tDifficulty *big.Int       `json:\"difficulty\" gencodec:\"required\"`\n\tMixhash    common.Hash    `json:\"mixHash\"`\n\tCoinbase   common.Address `json:\"coinbase\"`\n\tAlloc      GenesisAlloc   `json:\"alloc\"      gencodec:\"required\"`\n\tMState     *GenesisMState `json:\"mstate\"    gencodec:\"required\"`\n\t// These fields are used for consensus tests. Please don't use them\n\t// in actual genesis blocks.\n\tNumber     uint64                        `json:\"number\"`\n\tGasUsed    uint64                        `json:\"gasUsed\"`\n\tParentHash common.Hash                   `json:\"parentHash\"`\n\tRoots      []common.CoinRoot             `json:\"stateRoot\"        gencodec:\"required\"`\n\tSharding   []common.Coinbyte             `json:\"sharding,omitempty\"`\n\tCurrencys  map[string][]Genesiscurrencys `json:\"currencys\"`\n}\n```\nGenesis specifies the header fields, state of a genesis block. It also defines hard fork switch-over blocks through the chain configuration.\n\n```go\nfunc DefaultGenesis(genesisFile string) (*Genesis, error)\n```\n\n```go\nfunc DefaultGenesisBlock() *Genesis\n```\nDefaultGenesisBlock returns the Matrix main net genesis block.\n\n```go\nfunc DefaultRinkebyGenesisBlock() *Genesis\n```\nDefaultRinkebyGenesisBlock returns the Rinkeby network genesis block.\n\n```go\nfunc DefaultTestnetGenesisBlock() *Genesis\n```\nDefaultTestnetGenesisBlock returns the Ropsten network genesis block.\n\n```go\nfunc DeveloperGenesisBlock(period uint64, faucet common.Address) *Genesis\n```\nDeveloperGenesisBlock returns the 'gman --dev' genesis block. Note, this must be seeded with the\n\n```go\nfunc (g *Genesis) Commit(db mandb.Database) (*types.Block, error)\n```\nCommit writes the block and state of a genesis specification to the database. The block is committed as the canonical head block.\n\n```go\nfunc (g *Genesis) GenSuperBlock(parentHeader *types.Header, mdb mandb.Database, sdb state.Database, chainCfg *params.ChainConfig) *types.Block\n```\n\n```go\nfunc (g Genesis) MarshalJSON() ([]byte, error)\n```\n\n```go\nfunc (g *Genesis) MustCommit(db mandb.Database) *types.Block\n```\nMustCommit writes the genesis block and state to db, panicking on error. The block is committed as the canonical head block.\n\n```go\nfunc (g *Genesis) ToBlock(db mandb.Database) (*types.Block, error)\n```\nToBlock creates the genesis block and writes state of a genesis specification to the given database (or discards it if nil).\n\n```go\nfunc (g *Genesis) ToSuperBlock() *types.Block\n```\n\n```go\nfunc (g *Genesis) UnmarshalJSON(input []byte) error\n```\n\n```go\ntype GenesisAccount struct {\n\tCode       []byte                      `json:\"code,omitempty\"`\n\tStorage    map[common.Hash]common.Hash `json:\"storage,omitempty\"`\n\tBalance    *big.Int                    `json:\"balance\" gencodec:\"required\"`\n\tNonce      uint64                      `json:\"nonce,omitempty\"`\n\tPrivateKey []byte                      `json:\"secretKey,omitempty\"` // for tests\n}\n```\nGenesisAccount is an account in the state of the genesis block.\n\n```go\nfunc (g GenesisAccount) MarshalJSON() ([]byte, error)\n```\n\n```go\nfunc (g *GenesisAccount) UnmarshalJSON(input []byte) error\n```\n\n```go\ntype GenesisAddress common.Address\n```\n\n```go\nfunc (a GenesisAddress) MarshalText() ([]byte, error)\n```\n\tfunc (a *GenesisAddress) MarshalJSON() ([]byte, error) {\n\t\tbuff := base58.Base58EncodeToString(\"MAN\", common.Address(*a))\n\t\treturn []byte(buff),nil\n\t}\n\nMarshalText returns the hex representation of a.\n\n```go\nfunc (a *GenesisAddress) UnmarshalJSON(input []byte) error\n```\nUnmarshalJSON parses a hash in hex syntax.\n\n```go\nfunc (a *GenesisAddress) UnmarshalText(input []byte) error\n```\nUnmarshalText parses a hash in hex syntax.\n\n```go\ntype GenesisAlloc map[common.Address]GenesisAccount\n```\nGenesisAlloc specifies the initial state that is part of the genesis block.\n\n```go\nfunc (ga *GenesisAlloc) UnmarshalJSON(data []byte) error\n```\n\n```go\ntype GenesisElect struct {\n\tAccount GenesisAddress\n\tStock   uint16\n\tType    common.ElectRoleType\n\tVIP     common.VIPRoleType\n}\n```\n\n```go\nfunc TransToGenesisElect(elect common.Elect) GenesisElect\n```\n\n```go\ntype GenesisMState struct {\n\tBroadcasts                   *[]GenesisAddress                `json:\"Broadcasts,omitempty\"`\n\tInnerMiners                  *[]GenesisAddress                `json:\"InnerMiners,omitempty\"`\n\tFoundation                   *GenesisAddress                  `json:\"Foundation,omitempty\"`\n\tVersionSuperAccounts         *[]GenesisAddress                `json:\"VersionSuperAccounts,omitempty\"`\n\tBlockSuperAccounts           *[]GenesisAddress                `json:\"BlockSuperAccounts,omitempty\"`\n\tMultiCoinSuperAccounts       *[]GenesisAddress                `json:\"MultiCoinSuperAccounts,omitempty\"`\n\tSubChainSuperAccounts        *[]GenesisAddress                `json:\"SubChainSuperAccounts,omitempty\"`\n\tVIPCfg                       *[]mc.VIPConfig                  `json:\"VIPCfg,omitempty\" gencodec:\"required\"`\n\tBCICfg                       *mc.BCIntervalInfo               `json:\"BroadcastInterval,omitempty\" gencodec:\"required\"`\n\tLeaderCfg                    *mc.LeaderConfig                 `json:\"LeaderCfg,omitempty\" gencodec:\"required\"`\n\tBlkCalcCfg                   *string                          `json:\"BlkCalcCfg,omitempty\" gencodec:\"required\"`\n\tTxsCalcCfg                   *string                          `json:\"TxsCalcCfg,omitempty\" gencodec:\"required\"`\n\tInterestCalcCfg              *string                          `json:\"InterestCalcCfg,omitempty\" gencodec:\"required\"`\n\tLotteryCalcCfg               *string                          `json:\"LotteryCalcCfg,omitempty\" gencodec:\"required\"`\n\tSlashCalcCfg                 *string                          `json:\"SlashCalcCfg,omitempty\" gencodec:\"required\"`\n\tBlkRewardCfg                 *mc.BlkRewardCfg                 `json:\"BlkRewardCfg,omitempty\" gencodec:\"required\"`\n\tTxsRewardCfg                 *mc.TxsRewardCfg                 `json:\"TxsRewardCfg,omitempty\" gencodec:\"required\"`\n\tLotteryCfg                   *mc.LotteryCfg                   `json:\"LotteryCfg,omitempty\" gencodec:\"required\"`\n\tInterestCfg                  *mc.InterestCfg                  `json:\"InterestCfg,omitempty\" gencodec:\"required\"`\n\tSlashCfg                     *mc.SlashCfg                     `json:\"SlashCfg,omitempty\" gencodec:\"required\"`\n\tEleTimeCfg                   *mc.ElectGenTimeStruct           `json:\"EleTime,omitempty\" gencodec:\"required\"`\n\tEleInfoCfg                   *mc.ElectConfigInfo              `json:\"EleInfo,omitempty\" gencodec:\"required\"`\n\tElectMinerNumCfg             *mc.ElectMinerNumStruct          `json:\"ElectMinerNum,omitempty\" gencodec:\"required\"`\n\tElectBlackListCfg            *[]GenesisAddress                `json:\"ElectBlackList,omitempty\" gencodec:\"required\"`\n\tElectWhiteListSwitcherCfg    *mc.ElectWhiteListSwitcher       `json:\"ElectWhiteListSwitcherCfg,omitempty\" gencodec:\"required\"`\n\tElectWhiteListCfg            *[]GenesisAddress                `json:\"ElectWhiteList,omitempty\" gencodec:\"required\"`\n\tCurElect                     *[]GenesisElect                  `json:\"CurElect,omitempty\"  gencodec:\"required\"`\n\tBlockProduceSlashCfg         *mc.BlockProduceSlashCfg         `json:\"BlkProduceSlashCfg,omitempty\" gencodec:\"required\"`\n\tBlockProduceStats            *mc.BlockProduceStats            `json:\"BlkProduceStats,omitempty\" gencodec:\"required\"`\n\tBlockProduceSlashBlackList   *mc.BlockProduceSlashBlackList   `json:\"BlkProduceBlackList,omitempty\" gencodec:\"required\"`\n\tBlockProduceSlashStatsStatus *mc.BlockProduceSlashStatsStatus `json:\"BlkProduceStatus,omitempty\" gencodec:\"required\"`\n}\n```\n\n```go\nfunc (g *GenesisMState) SetSuperBlkToState(state *state.StateDBManage, extra []byte, num uint64) error\n```\n\n```go\ntype GenesisMismatchError struct {\n\tStored, New common.Hash\n}\n```\nGenesisMismatchError is raised when trying to overwrite an existing genesis block with an incompatible one.\n\n```go\nfunc (e *GenesisMismatchError) Error() string\n```\n\n```go\ntype GenesisNetTopology struct {\n\tType            uint8\n\tNetTopologyData []GenesisNetTopologyData\n}\n```\n\n```go\nfunc TransToGenesisNetTopology(topology common.NetTopology) GenesisNetTopology\n```\n\n```go\ntype GenesisNetTopologyData struct {\n\tAccount  GenesisAddress\n\tPosition uint16\n}\n```\n\n```go\ntype Genesiscurrencys struct {\n\tAccount string\n\tQuant   *big.Int\n}\n```\n\n```go\nfunc (gc Genesiscurrencys) MarshalJSON() ([]byte, error)\n```\n\n```go\nfunc (g *Genesiscurrencys) UnmarshalJSON(input []byte) error\n```\n\n```go\ntype HeaderChain struct {\n\t// contains filtered or unexported fields\n}\n```\nHeaderChain implements the basic block header chain logic that is shared by core.BlockChain and light.LightChain. It is not usable in itself, only as a part of either structure. It is not thread safe either, the encapsulating chain structures should do the necessary mutex locking/unlocking.\n\n```go\nfunc NewHeaderChain(chainDb mandb.Database, config *params.ChainConfig, procInterrupt func() bool) (*HeaderChain, error)\n```\nNewHeaderChain creates a new HeaderChain structure.\n\n\tgetValidator should return the parent's validator\n\tprocInterrupt points to the parent's interrupt semaphore\n\twg points to the parent's shutdown wait group\n\n```go\nfunc (hc *HeaderChain) Config() *params.ChainConfig\n```\nConfig retrieves the header chain's chain configuration.\n\n```go\nfunc (hc *HeaderChain) CurrentHeader() *types.Header\n```\nCurrentHeader retrieves the current head header of the canonical chain. The header is retrieved from the HeaderChain's internal cache.\n\n```go\nfunc (hc *HeaderChain) Engine(version string) consensus.Engine\n```\nEngine retrieves the header chain's consensus engine.\n\n```go\nfunc (hc *HeaderChain) GetAncestorHash(sonHash common.Hash, ancestorNumber uint64) (common.Hash, error)\n```\n\n```go\nfunc (hc *HeaderChain) GetBlock(hash common.Hash, number uint64) *types.Block\n```\nGetBlock implements consensus.ChainReader, and returns nil for every input as a header chain does not have blocks available for retrieval.\n\n```go\nfunc (hc *HeaderChain) GetBlockHashesFromHash(hash common.Hash, max uint64) []common.Hash\n```\nGetBlockHashesFromHash retrieves a number of block hashes starting at a given hash, fetching towards the genesis block.\n\n```go\nfunc (hc *HeaderChain) GetBlockNumber(hash common.Hash) *uint64\n```\nGetBlockNumber retrieves the block number belonging to the given hash from the cache or database\n\n```go\nfunc (hc *HeaderChain) GetHeader(hash common.Hash, number uint64) *types.Header\n```\nGetHeader retrieves a block header from the database by hash and number, caching it if found.\n\n```go\nfunc (hc *HeaderChain) GetHeaderByHash(hash common.Hash) *types.Header\n```\nGetHeaderByHash retrieves a block header from the database by hash, caching it if found.\n\n```go\nfunc (hc *HeaderChain) GetHeaderByNumber(number uint64) *types.Header\n```\nGetHeaderByNumber retrieves a block header from the database by number, caching it (associated with its hash) if found.\n\n```go\nfunc (hc *HeaderChain) GetTd(hash common.Hash, number uint64) *big.Int\n```\n\n```go\nfunc (hc *HeaderChain) GetTdByHash(hash common.Hash) *big.Int\n```\nGetTdByHash retrieves a block's total difficulty in the canonical chain from the database by hash, caching it if found.\n\n```go\nfunc (hc *HeaderChain) HasHeader(hash common.Hash, number uint64) bool\n```\nHasHeader checks if a block header is present in the database or not.\n\n```go\nfunc (hc *HeaderChain) InsertHeaderChain(chain []*types.Header, writeHeader WhCallback, start time.Time) (int, error)\n```\nInsertHeaderChain attempts to insert the given header chain in to the local chain, possibly creating a reorg. If an error is returned, it will return the index number of the failing header as well an error describing what went wrong.\n\nThe verify parameter can be used to fine tune whether nonce verification should be done or not. The reason behind the optional check is because some of the header retrieval mechanisms already need to verfy nonces, as well as because nonces can be verified sparsely, not needing to check each.\n\n```go\nfunc (hc *HeaderChain) SetCurrentHeader(head *types.Header)\n```\nSetCurrentHeader sets the current head header of the canonical chain.\n\n```go\nfunc (hc *HeaderChain) SetDposEngine(version string, engine consensus.DPOSEngine)\n```\n\n```go\nfunc (hc *HeaderChain) SetEngine(version string, engine consensus.Engine)\n```\n\n```go\nfunc (hc *HeaderChain) SetGenesis(head *types.Header)\n```\nSetGenesis sets a new genesis block header for the chain\n\n```go\nfunc (hc *HeaderChain) SetHead(head uint64, delFn DeleteCallback)\n```\nSetHead rewinds the local chain to a new head. Everything above the new head will be deleted and the new one set.\n\n```go\nfunc (hc *HeaderChain) SetSBlkHead(oldHead *types.Header, head uint64, delFn DeleteCallback)\n```\nSetHead rewinds the local chain to a new head. Everything above the new head will be deleted and the new one set.\n\n```go\nfunc (hc *HeaderChain) ValidateHeaderChain(chain []*types.Header, checkFreq int) (int, error)\n```\n\n```go\nfunc (hc *HeaderChain) WriteHeader(header *types.Header) (status WriteStatus, err error)\n```\nWriteHeader writes a header into the local chain, given that its parent is already known. If the total difficulty of the newly inserted header becomes greater than the current known TD, the canonical chain is re-routed.\n\nNote: This method is not concurrent-safe with inserting blocks simultaneously into the chain, as side effects caused by reorganisations cannot be emulated without the real blocks. Hence, writing headers directly should only be done in two scenarios: pure-header mode of operation (light clients), or properly separated header/block phases (non-archive clients).\n\n```go\nfunc (hc *HeaderChain) WriteTd(hash common.Hash, number uint64, td *big.Int) error\n```\nWriteTd stores a block's total difficulty into the database, also caching it along the way.\n\n```go\ntype MatrixProcessor struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewMatrixProcessor() *MatrixProcessor\n```\n\n```go\nfunc (mp *MatrixProcessor) ProcessMatrixState(block *types.Block, preVersion string, state *state.StateDBManage) error\n```\n\n```go\nfunc (mp *MatrixProcessor) ProcessStateVersion(version []byte, state *state.StateDBManage) error\n```\n\n```go\nfunc (mp *MatrixProcessor) RegisterProducer(key string, producer ProduceMatrixStateDataFn)\n```\n\n```go\ntype MessageProcess interface {\n\tProcessMsg(m NetworkMsgData)\n\tSendMsg(data MsgStruct)\n}\n```\n消息中心的接口（如果需要消息中心就要实现这两个方法）\n\n```go\ntype MsgStruct struct {\n\tMsgtype    uint32\n\tSendAddr   common.Address\n\tMsgData    []byte\n\tTxpoolType byte\n}\n```\n\n```go\ntype NetworkMsgData struct {\n\tSendAddress common.Address\n\tData        []*MsgStruct\n}\n```\n\n```go\ntype NewMinedBlockEvent struct{ Block *types.Block }\n```\nNewMinedBlockEvent is posted when a block has been imported.\n\n```go\ntype NewTxsEvent struct {\n\tTxs types.SelfTransactions\n\t// contains filtered or unexported fields\n}\n```\nNewTxsEvent is posted when a batch of transactions enter the transaction pool.\n\n```go\ntype NormalTxPool struct {\n\tSContainer map[common.Hash]*types.Transaction\n\tNContainer map[uint32]*types.Transaction\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewTxPool(config TxPoolConfig, chainconfig *params.ChainConfig, chain blockChain, sendch chan NewTxsEvent) *NormalTxPool\n```\n\n```go\nfunc (nPool *NormalTxPool) AddTxPool(txer types.SelfTransaction) error\n```\nAddLocal enqueues a single transaction into the pool if it is valid, marking the sender as a local one in the mean time, ensuring it goes around the local pricing constraints.\n\n```go\nfunc (nPool *NormalTxPool) CheckTx(mapSN map[uint32]*big.Int, nid common.Address)\n```\n检查当前map中是否存在洪泛过来的交易\n\n```go\nfunc (nPool *NormalTxPool) Content() map[common.Address][]*types.Transaction\n```\nContent retrieves the data content of the transaction pool, returning all the pending as well as queued transactions, grouped by account and sorted by nonce.\n\n```go\nfunc (nPool *NormalTxPool) DemoteUnexecutables()\n```\ndemoteUnexecutables removes invalid and processed transactions from the pools executable/pending queue and any subsequent transactions that become unexecutable are moved back into the future queue.\n\n```go\nfunc (nPool *NormalTxPool) Get(hash common.Hash) *types.Transaction\n```\nGet returns a transaction if it is contained in the pool and nil otherwise.\n\n```go\nfunc (nPool *NormalTxPool) GetConsensusTxByN(listN []uint32, nid common.Address)\n```\n(共识要交易)根据N值获取对应的交易(modi  )\n\n```go\nfunc (nPool *NormalTxPool) GetTxByN(listN []uint32, nid common.Address)\n```\n根据N值获取对应的交易(洪泛)\n\n```go\nfunc (nPool *NormalTxPool) GetTxNmap() map[uint32]*types.Transaction\n```\n\n```go\nfunc (nPool *NormalTxPool) ListenUdp()\n```\n\n```go\nfunc (nPool *NormalTxPool) Pending() (map[string]map[common.Address]types.SelfTransactions, error)\n```\nPending retrieves all currently processable transactions, groupped by origin account and sorted by nonce. The returned transaction set is a copy and can be freely modified by calling code.\n\n```go\nfunc (nPool *NormalTxPool) ProcessMsg(m NetworkMsgData)\n```\nProcessMsg\n\n```go\nfunc (nPool *NormalTxPool) RecvConsensusFloodTx(mapNtx map[uint32]types.SelfTransaction, nid common.Address)\n```\n此接口传的交易带s(modi  )\n\n```go\nfunc (nPool *NormalTxPool) RecvErrTx(addr common.Address, listS []*big.Int)\n```\n接收错误交易\n\n```go\nfunc (nPool *NormalTxPool) RecvFloodTx(mapNtx map[uint32]*types.Floodtxdata, nid common.Address)\n```\n接收洪泛的交易（根据N请求到的交易）\n\n```go\nfunc (nPool *NormalTxPool) ReturnAllTxsByN(listN []uint32, resqe byte, addr common.Address, retch chan *RetChan_txpool)\n```\n接收到Leader打包的交易共识消息时根据N获取tx (调用本方法需要启动协程)\n\n```go\nfunc (nPool *NormalTxPool) SendMsg(data MsgStruct)\n```\nSendMsg\n\n```go\nfunc (nPool *NormalTxPool) State() *state.ManagedState\n```\nState returns the virtual managed state of the transaction pool.\n\n```go\nfunc (nPool *NormalTxPool) Stats() (int, int)\n```\nStats retrieves the current pool stats, namely the number of pending and the number of queued (non-executable) transactions.\n\n```go\nfunc (nPool *NormalTxPool) Status(hashes []common.Hash) []TxStatus\n```\nStatus returns the status (unknown/pending/queued) of a batch of transactions identified by their hashes.\n\n```go\nfunc (nPool *NormalTxPool) Stop()\n```\nStop terminates the transaction pool.\n\n```go\nfunc (nPool *NormalTxPool) Type() byte\n```\nType return txpool type.\n\n```go\ntype PendingLogsEvent struct {\n\tLogs []types.CoinLogs\n}\n```\nPendingLogsEvent is posted pre mining and notifies of pending logs.\n\n```go\ntype PendingStateEvent struct{}\n```\nPendingStateEvent is posted pre mining and notifies of pending state changes.\n\n```go\ntype PreStateReadFn func(key string) (interface{}, error)\n```\n\n```go\ntype Processor interface {\n\tProcessSuperBlk(block *types.Block, statedb *state.StateDBManage) error\n\tProcessTxs(block *types.Block, statedb *state.StateDBManage, cfg vm.Config, upTime map[common.Address]uint64) ([]types.CoinLogs, uint64, error)\n\tProcess(block *types.Block, parent *types.Block, statedb *state.StateDBManage, cfg vm.Config) ([]types.CoinReceipts, []types.CoinLogs, uint64, error)\n\tSetRandom(random *baseinterface.Random)\n\tProcessReward(state *state.StateDBManage, header *types.Header, upTime map[common.Address]uint64, account map[string][]common.Address, usedGas map[string]*big.Int) []common.RewarTx\n}\n```\nProcessor is an interface for processing blocks using a given initial state.\n\nProcess takes the block to be processed and the statedb upon which the initial state is based. It should return the receipts generated, amount of gas used in the process and return an error if any of the internal rules failed.\n\n```go\ntype ProduceMatrixStateDataFn func(block *types.Block, stateDb *state.StateDBManage, readFn PreStateReadFn) (interface{}, error)\n```\n\n```go\ntype RemovedLogsEvent struct{ Logs []types.CoinLogs }\n```\nRemovedLogsEvent is posted when a reorg happens\n\n```go\ntype RetCallTx struct {\n\tTXt byte\n\t//ListN []uint32\n\tTxser []types.SelfTransaction\n}\n```\n\n```go\ntype RetChan struct {\n\t//Rxs   []types.SelfTransaction\n\tAllTxs []*RetCallTx\n\tErr    error\n\tResqe  int\n}\n```\n\n```go\ntype RetChan_txpool struct {\n\tRxs  []types.SelfTransaction\n\tErr  error\n\tTx_t byte\n}\n```\n\n```go\ntype StateProcessor struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewStateProcessor(config *params.ChainConfig, bc *BlockChain, engine consensus.Engine) *StateProcessor\n```\nNewStateProcessor initialises a new StateProcessor.\n\n```go\nfunc (p *StateProcessor) Process(block *types.Block, parent *types.Block, statedb *state.StateDBManage, cfg vm.Config) ([]types.CoinReceipts, []types.CoinLogs, uint64, error)\n```\n\n```go\nfunc (p *StateProcessor) ProcessReward(st *state.StateDBManage, header *types.Header, upTime map[common.Address]uint64, account map[string][]common.Address, usedGas map[string]*big.Int) []common.RewarTx\n```\n\n```go\nfunc (p *StateProcessor) ProcessSuperBlk(block *types.Block, statedb *state.StateDBManage) error\n```\n\n```go\nfunc (p *StateProcessor) ProcessTxs(block *types.Block, statedb *state.StateDBManage, cfg vm.Config, upTime map[common.Address]uint64) ([]types.CoinLogs, uint64, error)\n```\nProcess processes the state changes according to the Matrix rules by running the transaction messages using the statedb and applying any rewards to both the processor (coinbase) and any included uncles.\n\nProcess returns the receipts and logs accumulated during the process and returns the amount of gas that was used in the process. If any of the transactions failed to execute due to insufficient gas it will return an error.\n\n```go\nfunc (p *StateProcessor) SetRandom(random *baseinterface.Random)\n```\n\n```go\ntype StateTransition struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewStateTransition(evm *vm.EVM, msg txinterface.Message, gp *GasPool) *StateTransition\n```\nNewStateTransition initialises and returns a new state transition object.\n\n```go\nfunc (st *StateTransition) BuyGas() error\n```\n扣各自币种的gas\n\n```go\nfunc (st *StateTransition) BuyGas_coin() error\n```\n按币种分区扣gas（该接口废弃）\n\n```go\nfunc (st *StateTransition) CallAuthTx() (ret []byte, usedGas uint64, failed bool, shardings []uint, err error)\n```\n授权交易的from和to是同一个地址\n\n```go\nfunc (st *StateTransition) CallCancelAuthTx() (ret []byte, usedGas uint64, failed bool, shardings []uint, err error)\n```\n\n```go\nfunc (st *StateTransition) CallMakeCoinTx() (ret []byte, usedGas uint64, failed bool, shardings []uint, err error)\n```\n\n```go\nfunc (st *StateTransition) CallNormalTx() (ret []byte, usedGas uint64, failed bool, shardings []uint, err error)\n```\n\n```go\nfunc (st *StateTransition) CallRevertNormalTx() (ret []byte, usedGas uint64, failed bool, shardings []uint, err error)\n```\n\n```go\nfunc (st *StateTransition) CallRevocableNormalTx() (ret []byte, usedGas uint64, failed bool, shardings []uint, err error)\n```\n\n```go\nfunc (st *StateTransition) CallSetBlackListTx() (ret []byte, usedGas uint64, failed bool, shardings []uint, err error)\n```\n\n```go\nfunc (st *StateTransition) CallTimeNormalTx() (ret []byte, usedGas uint64, failed bool, shardings []uint, err error)\n```\n\n```go\nfunc (st *StateTransition) CallUnGasNormalTx() (ret []byte, usedGas uint64, failed bool, shardings []uint, err error)\n```\n\n```go\nfunc (st *StateTransition) GasUsed() uint64\n```\ngasUsed returns the amount of gas used up by the state transition.\n\n```go\nfunc (st *StateTransition) PreCheck() error\n```\n\n```go\nfunc (st *StateTransition) RefundGas(coinrange string)\n```\n\n```go\nfunc (st *StateTransition) To() common.Address\n```\nto returns the recipient of the message.\n\n```go\nfunc (st *StateTransition) TransitionDb() (ret []byte, usedGas uint64, failed bool, shardings []uint, err error)\n```\n\n```go\nfunc (st *StateTransition) UseGas(amount uint64) error\n```\n\n```go\ntype TopologyStore struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewTopologyStore(bc *BlockChain) *TopologyStore\n```\n\n```go\nfunc (ts *TopologyStore) GetBroadcastAccounts(blockHash common.Hash) ([]common.Address, error)\n```\n\n```go\nfunc (ts *TopologyStore) GetCurrentHash() common.Hash\n```\n\n```go\nfunc (ts *TopologyStore) GetElectGraphByHash(blockHash common.Hash) (*mc.ElectGraph, error)\n```\n\n```go\nfunc (ts *TopologyStore) GetElectOnlineStateByHash(blockHash common.Hash) (*mc.ElectOnlineStatus, error)\n```\n\n```go\nfunc (ts *TopologyStore) GetHashByNumber(number uint64) common.Hash\n```\n\n```go\nfunc (ts *TopologyStore) GetInnerMinersAccount(blockHash common.Hash) ([]common.Address, error)\n```\n\n```go\nfunc (ts *TopologyStore) GetNextElectByHash(blockHash common.Hash) ([]common.Elect, error)\n```\n\n```go\nfunc (ts *TopologyStore) GetOriginalElectByHash(blockHash common.Hash) ([]common.Elect, error)\n```\n\n```go\nfunc (ts *TopologyStore) GetSuperSeq(blockHash common.Hash) (uint64, error)\n```\n\n```go\nfunc (ts *TopologyStore) GetTopologyGraphByHash(blockHash common.Hash) (*mc.TopologyGraph, error)\n```\n\n```go\nfunc (ts TopologyStore) ProduceTopologyStateData(block *types.Block, state *state.StateDBManage, readFn PreStateReadFn) (interface{}, error)\n```\n\n```go\ntype TxFlood interface {\n\tCheckTx(mapSN map[uint32]*big.Int, nid discover.NodeID)\n\tGetTxByN(listN []uint32, nid discover.NodeID)\n\tGetConsensusTxByN(listN []uint32, nid discover.NodeID)\n\tRecvConsensusFloodTx(mapNtx map[uint32]types.SelfTransaction, nid discover.NodeID)\n\tRecvFloodTx(mapNtx map[uint32]*types.Floodtxdata, nid discover.NodeID)\n\tRecvErrTx(addr common.Address, listS []*big.Int)\n}\n```\n洪泛交易的接口（如果需要洪泛交易就要实现以下方法，同时还包括链表、交易流水线等）\n\n```go\ntype TxPool interface {\n\tType() byte\n\tStop()\n\tAddTxPool(tx types.SelfTransaction) error\n\tPending() (map[string]map[common.Address]types.SelfTransactions, error)\n\tReturnAllTxsByN(listN []uint32, resqe byte, addr common.Address, retch chan *RetChan_txpool)\n}\n```\nTxPool interface\n\n```go\ntype TxPoolConfig struct {\n\tPriceLimit   uint64 // Minimum gas price to enforce for acceptance into the pool\n\tAccountSlots uint64 // Minimum number of executable transaction slots guaranteed per account\n\tGlobalSlots  uint64 // Maximum number of executable transaction slots for all accounts\n\tAccountQueue uint64 // Maximum number of non-executable transaction slots permitted per account\n\tGlobalQueue  uint64 // Maximum number of non-executable transaction slots for all accounts\n\t// contains filtered or unexported fields\n}\n```\nTxPoolConfig are the configuration parameters of the transaction pool.\n\n```go\ntype TxPoolManager struct {\n\t// contains filtered or unexported fields\n}\n```\nTxPoolManager\n\n```go\nfunc NewTxPoolManager(config TxPoolConfig, chainconfig *params.ChainConfig, chain blockChain, path string) *TxPoolManager\n```\n\n```go\nfunc (pm *TxPoolManager) AddBroadTx(tx types.SelfTransaction, bType bool) (err error)\n```\nAddBroadTx add broadcast transaction.\n\n```go\nfunc (pm *TxPoolManager) AddRemote(tx types.SelfTransaction) (err error)\n```\n\n```go\nfunc (pm *TxPoolManager) AddRemotes(txs []types.SelfTransaction) []error\n```\n\n```go\nfunc (pm *TxPoolManager) GetAllSpecialTxs() (reqVal map[common.Address][]types.SelfTransaction)\n```\nGetAllSpecialTxs get all special transactions.\n\n```go\nfunc (pm *TxPoolManager) GetTxPoolByType(tp byte) (txPool TxPool, err error)\n```\nGetTxPoolByType get txpool by given type from manager.\n\n```go\nfunc (pm *TxPoolManager) Pending() (map[string]map[common.Address]types.SelfTransactions, error)\n```\n\n```go\nfunc (pm *TxPoolManager) ProcessMsg(m NetworkMsgData)\n```\nProcessMsg\n\n```go\nfunc (pm *TxPoolManager) ReturnAllTxsByN(listretctx []*common.RetCallTxN, resqe int, addr common.Address, retch chan *RetChan)\n```\n\n```go\nfunc (pm *TxPoolManager) SendMsg(data MsgStruct)\n```\nSendMsg\n\n```go\nfunc (pm *TxPoolManager) Stats() (int, int)\n```\n\n```go\nfunc (pm *TxPoolManager) Stop()\n```\nStop txpool manager.\n\n```go\nfunc (pm *TxPoolManager) Subscribe(pool TxPool) error\n```\nSubscribe a txpool into manager.\n\n```go\nfunc (pm *TxPoolManager) SubscribeNewTxsEvent(ch chan NewTxsEvent) (ev event.Subscription)\n```\n\n```go\nfunc (pm *TxPoolManager) UnSubscribe(pool TxPool) error\n```\nUnSubscribe a txpool from manager.\n\n```go\ntype TxStatus uint\n```\nTxStatus is the current status of a transaction as seen by the pool.\n\n```go\nconst (\n\tTxStatusUnknown TxStatus = iota\n\tTxStatusQueued\n\tTxStatusPending\n\tTxStatusIncluded\n)\n```\n\n```go\ntype TxpoolEx interface {\n\tDemoteUnexecutables()\n\tListenUdp()\n}\n```\n\n```go\ntype Validator interface {\n\t// ValidateBody validates the given block's content.\n\tValidateBody(block *types.Block) error\n\t// ValidateBody validates the given block's content.\n\tValidateHeader(header *types.Header) error\n\t// ValidateState validates the given statedb and optionally the receipts and\n\t// gas used.\n\t//ValidateState(block, parent *types.Block, state *state.StateDBManage, receipts types.Receipts, usedGas uint64) error\n\tValidateState(block, parent *types.Block, statedb *state.StateDBManage, usedGas uint64) error\n}\n```\nValidator is an interface which defines the standard for block validation. It is only responsible for validating block contents, as the header validation is done by the specific consensus engines.\n\n```go\ntype WhCallback func(*types.Header) error\n```\nWhCallback is a callback function for inserting individual headers. A callback is used for two reasons: first, in a LightChain, status should be processed and light chain events sent, while in a BlockChain this is not necessary since chain events are sent after inserting blocks. Second, the header writes should be protected by the parent chain mutex individually.\n\n```go\ntype WriteStatus byte\n```\nWriteStatus status of write\n\n```go\nconst (\n\tNonStatTy WriteStatus = iota\n\tCanonStatTy\n\tSideStatTy\n)\n```\n\n","path":"github.com/chainopen/matrixchaincode/core","name":"core","synopsis":"Package core implements the Matrix consensus protocol.","isRedistributable":true}
