aboutsummaryrefslogtreecommitdiffstats
path: root/ethchain
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-02-24 20:15:34 +0800
committerobscuren <geffobscura@gmail.com>2014-02-24 20:15:34 +0800
commit6c7255cde2afdff7710af23c9830835398e6b43d (patch)
tree1173adf43af2f0d7fd10c8f2fa5b35bf9807c8ad /ethchain
parentf2234264ed255a8096c2eb29e1b5ddb120c5ca3f (diff)
downloaddexon-6c7255cde2afdff7710af23c9830835398e6b43d.tar.gz
dexon-6c7255cde2afdff7710af23c9830835398e6b43d.tar.zst
dexon-6c7255cde2afdff7710af23c9830835398e6b43d.zip
Fixed a minor issue on crashed contracts
Diffstat (limited to 'ethchain')
-rw-r--r--ethchain/block.go5
-rw-r--r--ethchain/contract.go3
2 files changed, 6 insertions, 2 deletions
diff --git a/ethchain/block.go b/ethchain/block.go
index 7ad9984be..472ae134a 100644
--- a/ethchain/block.go
+++ b/ethchain/block.go
@@ -221,8 +221,9 @@ func (block *Block) Undo() {
func (block *Block) MakeContract(tx *Transaction) {
contract := MakeContract(tx, NewState(block.state))
-
- block.contractStates[string(tx.Hash()[12:])] = contract.state
+ if contract != nil {
+ block.contractStates[string(tx.Hash()[12:])] = contract.state
+ }
}
/////// Block Encoding
diff --git a/ethchain/contract.go b/ethchain/contract.go
index dbcbb3697..14abb05d1 100644
--- a/ethchain/contract.go
+++ b/ethchain/contract.go
@@ -1,6 +1,7 @@
package ethchain
import (
+ "fmt"
"github.com/ethereum/eth-go/ethutil"
"math/big"
)
@@ -65,6 +66,8 @@ func MakeContract(tx *Transaction, state *State) *Contract {
state.trie.Update(string(addr), string(contract.RlpEncode()))
return contract
+ } else {
+ fmt.Println("NO CONTRACT")
}
return nil