forked from cerc-io/plugeth
Fixed a minor issue on crashed contracts
This commit is contained in:
parent
f2234264ed
commit
6c7255cde2
@ -221,9 +221,10 @@ func (block *Block) Undo() {
|
|||||||
|
|
||||||
func (block *Block) MakeContract(tx *Transaction) {
|
func (block *Block) MakeContract(tx *Transaction) {
|
||||||
contract := MakeContract(tx, NewState(block.state))
|
contract := MakeContract(tx, NewState(block.state))
|
||||||
|
if contract != nil {
|
||||||
block.contractStates[string(tx.Hash()[12:])] = contract.state
|
block.contractStates[string(tx.Hash()[12:])] = contract.state
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/////// Block Encoding
|
/////// Block Encoding
|
||||||
func (block *Block) encodedUncles() interface{} {
|
func (block *Block) encodedUncles() interface{} {
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package ethchain
|
package ethchain
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"github.com/ethereum/eth-go/ethutil"
|
"github.com/ethereum/eth-go/ethutil"
|
||||||
"math/big"
|
"math/big"
|
||||||
)
|
)
|
||||||
@ -65,6 +66,8 @@ func MakeContract(tx *Transaction, state *State) *Contract {
|
|||||||
state.trie.Update(string(addr), string(contract.RlpEncode()))
|
state.trie.Update(string(addr), string(contract.RlpEncode()))
|
||||||
|
|
||||||
return contract
|
return contract
|
||||||
|
} else {
|
||||||
|
fmt.Println("NO CONTRACT")
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
Reference in New Issue
Block a user