Skip to content

Commit 0db86e4

Browse files
committed
Updated to work with the new chain
1 parent 85e0447 commit 0db86e4

4 files changed

Lines changed: 12 additions & 7 deletions

File tree

‎Makefile‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ all:
77
install:
88
# Linux build
99
ifeq ($(UNAME),Linux)
10-
mkdir /usr/local/ethereal
11-
files=(wallet.qml net.png network.png new.png tx.png)
10+
mkdir -p /usr/local/ethereal
11+
files=(net.png network.png new.png tx.png)
1212
for file in "${files[@]}"; do
1313
cp $file /usr/share/ethereal
1414
done
15+
cp -r qml /usr/share/ethereal/qml
1516
cp $GOPATH/bin/go-ethereum /usr/local/bin/ethereal
1617
endif
1718
# OS X build

‎ethereum.go‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,16 +190,19 @@ func main() {
190190
// Apply all transactions to the block
191191
ethereum.StateManager().ApplyTransactions(block, block.Transactions())
192192

193-
ethereum.StateManager().AccumelateRewards(block, block)
193+
ethereum.StateManager().Prepare(block.State(), block.State())
194+
ethereum.StateManager().AccumelateRewards(block)
194195

195196
// Search the nonce
196197
block.Nonce = pow.Search(block)
197198
ethereum.Broadcast(ethwire.MsgBlockTy, []interface{}{block.Value().Val})
199+
200+
ethereum.StateManager().PrepareDefault(block)
198201
err := ethereum.StateManager().ProcessBlock(block)
199202
if err != nil {
200203
log.Println(err)
201204
} else {
202-
//log.Println("\n+++++++ MINED BLK +++++++\n", ethereum.BlockChain().CurrentBlock)
205+
log.Println("\n+++++++ MINED BLK +++++++\n", ethereum.BlockChain().CurrentBlock)
203206
log.Printf("🔨 Mined block %x\n", block.Hash())
204207
}
205208
}

‎ui/gui.go‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ func (ui *Gui) Start() {
8181
Init: func(p *Tx, obj qml.Object) { p.Value = ""; p.Hash = ""; p.Address = "" },
8282
}})
8383

84+
ethutil.Config.SetClientString(fmt.Sprintf("/Ethereal v%s", "0.1"))
8485
ethutil.Config.Log.Infoln("[GUI] Starting GUI")
8586
// Create a new QML engine
8687
ui.engine = qml.NewEngine()

‎ui/library.go‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ func (lib *EthLib) CreateTx(receiver, a, data string) string {
2727
}
2828

2929
k, _ := ethutil.Config.Db.Get([]byte("KeyRing"))
30-
keyRing := ethutil.NewValueFromBytes(k)
30+
keyPair := ethutil.NewKeyFromBytes(k)
3131

3232
amount := ethutil.Big(a)
3333
code := ethchain.Compile(strings.Split(data, "\n"))
3434
tx := ethchain.NewTransaction(hash, amount, code)
35-
tx.Nonce = lib.stateManager.GetAddrState(keyRing.Get(1).Bytes()).Nonce
35+
tx.Nonce = lib.stateManager.GetAddrState(keyPair.Address()).Nonce
3636

37-
tx.Sign(keyRing.Get(0).Bytes())
37+
tx.Sign(keyPair.PrivateKey)
3838

3939
lib.txPool.QueueTransaction(tx)
4040

0 commit comments

Comments
 (0)