@@ -21,6 +21,7 @@ import (
21
21
"bufio"
22
22
"fmt"
23
23
"io"
24
+ "math/big"
24
25
"os"
25
26
"os/signal"
26
27
"regexp"
@@ -32,6 +33,7 @@ import (
32
33
"github.com/ethereum/go-ethereum/eth"
33
34
"github.com/ethereum/go-ethereum/logger"
34
35
"github.com/ethereum/go-ethereum/logger/glog"
36
+ "github.com/ethereum/go-ethereum/params"
35
37
"github.com/ethereum/go-ethereum/rlp"
36
38
"github.com/peterh/liner"
37
39
)
@@ -143,6 +145,15 @@ func StartEthereum(ethereum *eth.Ethereum) {
143
145
}()
144
146
}
145
147
148
+ func InitOlympic () {
149
+ params .DurationLimit = big .NewInt (8 )
150
+ params .GenesisGasLimit = big .NewInt (3141592 )
151
+ params .MinGasLimit = big .NewInt (125000 )
152
+ params .MaximumExtraDataSize = big .NewInt (1024 )
153
+ NetworkIdFlag .Value = 0
154
+ core .BlockReward = big .NewInt (1.5e+18 )
155
+ }
156
+
146
157
func FormatTransactionData (data string ) []byte {
147
158
d := common .StringToByteFunc (data , func (s string ) (ret []byte ) {
148
159
slice := regexp .MustCompile ("\\ n|\\ s" ).Split (s , 1000000000 )
@@ -203,6 +214,11 @@ func ImportChain(chain *core.ChainManager, fn string) error {
203
214
} else if err != nil {
204
215
return fmt .Errorf ("at block %d: %v" , n , err )
205
216
}
217
+ // don't import first block
218
+ if b .NumberU64 () == 0 {
219
+ i --
220
+ continue
221
+ }
206
222
blocks [i ] = & b
207
223
n ++
208
224
}
@@ -218,6 +234,7 @@ func ImportChain(chain *core.ChainManager, fn string) error {
218
234
batch , blocks [0 ].Hash ().Bytes ()[:4 ], blocks [i - 1 ].Hash ().Bytes ()[:4 ])
219
235
continue
220
236
}
237
+
221
238
if _ , err := chain .InsertChain (blocks [:i ]); err != nil {
222
239
return fmt .Errorf ("invalid block %d: %v" , n , err )
223
240
}
0 commit comments