aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-02-20 21:19:34 +0800
committerobscuren <geffobscura@gmail.com>2015-02-20 21:19:34 +0800
commitea9a549bbdc8377bca73f1417f2dc4a18396a382 (patch)
treef4f8719ad52f17b3db4b26626a9f5932870f9009 /core
parent5c975dd4ed7adb29453fa28e64c0193d323cae99 (diff)
downloaddexon-ea9a549bbdc8377bca73f1417f2dc4a18396a382.tar.gz
dexon-ea9a549bbdc8377bca73f1417f2dc4a18396a382.tar.zst
dexon-ea9a549bbdc8377bca73f1417f2dc4a18396a382.zip
Removed exported fields from state object and added proper set/getters
Diffstat (limited to 'core')
-rw-r--r--core/state_transition.go8
-rw-r--r--core/transaction_pool.go2
2 files changed, 5 insertions, 5 deletions
diff --git a/core/state_transition.go b/core/state_transition.go
index e82be647d..36ffa23d9 100644
--- a/core/state_transition.go
+++ b/core/state_transition.go
@@ -138,8 +138,8 @@ func (self *StateTransition) preCheck() (err error) {
)
// Make sure this transaction's nonce is correct
- if sender.Nonce != msg.Nonce() {
- return NonceError(msg.Nonce(), sender.Nonce)
+ if sender.Nonce() != msg.Nonce() {
+ return NonceError(msg.Nonce(), sender.Nonce())
}
// Pre-pay gas / Buy gas of the coinbase account
@@ -166,7 +166,7 @@ func (self *StateTransition) TransitionState() (ret []byte, err error) {
defer self.RefundGas()
// Increment the nonce for the next transaction
- self.state.SetNonce(sender.Address(), sender.Nonce+1)
+ self.state.SetNonce(sender.Address(), sender.Nonce()+1)
//sender.Nonce += 1
// Transaction gas
@@ -242,7 +242,7 @@ func MakeContract(msg Message, state *state.StateDB) *state.StateObject {
addr := AddressFromMessage(msg)
contract := state.GetOrNewStateObject(addr)
- contract.InitCode = msg.Data()
+ contract.SetInitCode(msg.Data())
return contract
}
diff --git a/core/transaction_pool.go b/core/transaction_pool.go
index 894b6c440..050cff3d8 100644
--- a/core/transaction_pool.go
+++ b/core/transaction_pool.go
@@ -169,7 +169,7 @@ func (pool *TxPool) RemoveInvalid(query StateQuery) {
for _, tx := range pool.txs {
sender := query.GetAccount(tx.From())
err := pool.ValidateTransaction(tx)
- if err != nil || sender.Nonce >= tx.Nonce() {
+ if err != nil || sender.Nonce() >= tx.Nonce() {
removedTxs = append(removedTxs, tx)
}
}