aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--accounts/abi/bind/backends/simulated.go3
-rw-r--r--common/registrar/ethreg/api.go5
-rw-r--r--core/state_transition.go7
-rw-r--r--core/types/transaction.go1
-rw-r--r--eth/api.go4
-rw-r--r--internal/ethapi/api.go4
-rw-r--r--tests/util.go1
7 files changed, 17 insertions, 8 deletions
diff --git a/accounts/abi/bind/backends/simulated.go b/accounts/abi/bind/backends/simulated.go
index 490da82a6..9bce3f988 100644
--- a/accounts/abi/bind/backends/simulated.go
+++ b/accounts/abi/bind/backends/simulated.go
@@ -203,7 +203,8 @@ type callmsg struct {
func (m callmsg) From() (common.Address, error) { return m.from.Address(), nil }
func (m callmsg) FromFrontier() (common.Address, error) { return m.from.Address(), nil }
-func (m callmsg) Nonce() uint64 { return m.from.Nonce() }
+func (m callmsg) Nonce() uint64 { return 0 }
+func (m callmsg) CheckNonce() bool { return false }
func (m callmsg) To() *common.Address { return m.to }
func (m callmsg) GasPrice() *big.Int { return m.gasPrice }
func (m callmsg) Gas() *big.Int { return m.gasLimit }
diff --git a/common/registrar/ethreg/api.go b/common/registrar/ethreg/api.go
index 6d77a9385..6dd0ef46f 100644
--- a/common/registrar/ethreg/api.go
+++ b/common/registrar/ethreg/api.go
@@ -128,7 +128,10 @@ func (m callmsg) FromFrontier() (common.Address, error) {
return m.from.Address(), nil
}
func (m callmsg) Nonce() uint64 {
- return m.from.Nonce()
+ return 0
+}
+func (m callmsg) CheckNonce() bool {
+ return false
}
func (m callmsg) To() *common.Address {
return m.to
diff --git a/core/state_transition.go b/core/state_transition.go
index c8160424b..9e6b2f567 100644
--- a/core/state_transition.go
+++ b/core/state_transition.go
@@ -71,6 +71,7 @@ type Message interface {
Value() *big.Int
Nonce() uint64
+ CheckNonce() bool
Data() []byte
}
@@ -208,8 +209,10 @@ func (self *StateTransition) preCheck() (err error) {
}
// Make sure this transaction's nonce is correct
- if n := self.state.GetNonce(sender.Address()); n != msg.Nonce() {
- return NonceError(msg.Nonce(), n)
+ if msg.CheckNonce() {
+ if n := self.state.GetNonce(sender.Address()); n != msg.Nonce() {
+ return NonceError(msg.Nonce(), n)
+ }
}
// Pre-pay gas
diff --git a/core/types/transaction.go b/core/types/transaction.go
index b99d3a716..c71c98aa7 100644
--- a/core/types/transaction.go
+++ b/core/types/transaction.go
@@ -113,6 +113,7 @@ func (tx *Transaction) Gas() *big.Int { return new(big.Int).Set(tx.data.Gas
func (tx *Transaction) GasPrice() *big.Int { return new(big.Int).Set(tx.data.Price) }
func (tx *Transaction) Value() *big.Int { return new(big.Int).Set(tx.data.Amount) }
func (tx *Transaction) Nonce() uint64 { return tx.data.AccountNonce }
+func (tx *Transaction) CheckNonce() bool { return true }
func (tx *Transaction) To() *common.Address {
if tx.data.Recipient == nil {
diff --git a/eth/api.go b/eth/api.go
index 74a815100..3b7abb69a 100644
--- a/eth/api.go
+++ b/eth/api.go
@@ -424,7 +424,6 @@ func (api *PrivateDebugAPI) traceBlock(block *types.Block, config *vm.Config) (b
// callmsg is the message type used for call transations.
type callmsg struct {
addr common.Address
- nonce uint64
to *common.Address
gas, gasPrice *big.Int
value *big.Int
@@ -434,7 +433,8 @@ type callmsg struct {
// accessor boilerplate to implement core.Message
func (m callmsg) From() (common.Address, error) { return m.addr, nil }
func (m callmsg) FromFrontier() (common.Address, error) { return m.addr, nil }
-func (m callmsg) Nonce() uint64 { return m.nonce }
+func (m callmsg) Nonce() uint64 { return 0 }
+func (m callmsg) CheckNonce() bool { return false }
func (m callmsg) To() *common.Address { return m.to }
func (m callmsg) GasPrice() *big.Int { return m.gasPrice }
func (m callmsg) Gas() *big.Int { return m.gas }
diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go
index 6e888fc93..f604a0ef2 100644
--- a/internal/ethapi/api.go
+++ b/internal/ethapi/api.go
@@ -534,7 +534,6 @@ func (s *PublicBlockChainAPI) GetStorageAt(ctx context.Context, address common.A
// callmsg is the message type used for call transations.
type callmsg struct {
addr common.Address
- nonce uint64
to *common.Address
gas, gasPrice *big.Int
value *big.Int
@@ -544,7 +543,8 @@ type callmsg struct {
// accessor boilerplate to implement core.Message
func (m callmsg) From() (common.Address, error) { return m.addr, nil }
func (m callmsg) FromFrontier() (common.Address, error) { return m.addr, nil }
-func (m callmsg) Nonce() uint64 { return m.nonce }
+func (m callmsg) Nonce() uint64 { return 0 }
+func (m callmsg) CheckNonce() bool { return false }
func (m callmsg) To() *common.Address { return m.to }
func (m callmsg) GasPrice() *big.Int { return m.gasPrice }
func (m callmsg) Gas() *big.Int { return m.gas }
diff --git a/tests/util.go b/tests/util.go
index abc67769d..877e1acdb 100644
--- a/tests/util.go
+++ b/tests/util.go
@@ -312,4 +312,5 @@ func (self Message) GasPrice() *big.Int { return self.price }
func (self Message) Gas() *big.Int { return self.gas }
func (self Message) Value() *big.Int { return self.value }
func (self Message) Nonce() uint64 { return self.nonce }
+func (self Message) CheckNonce() bool { return true }
func (self Message) Data() []byte { return self.data }
ER to my FreeBSD.org addresssunpoet2010-09-231-1/+1 * - Update to 0.80miwi2010-07-152-4/+4 * - Update to 0.79miwi2010-07-122-8/+9 * - update to 1.4.1dinoex2010-03-281-1/+1 * - update to jpeg-8dinoex2010-02-051-1/+1 * - bump all port that indirectly depends on libjpeg and have not yet been bump...dinoex2009-07-311-0/+1 * - Remove unreachable master sitechinsan2009-01-111-3/+3 * - Update to 0.75jadawin2008-10-012-4/+4 * - Update to 0.74rafan2008-08-254-434/+21 * Conversion from (now defunct) autoconf-2.61 to autoconf-2.62ade2008-08-201-1/+1 * Bump portrevision due to upgrade of devel/gettext.edwin2008-06-061-0/+1 * - Update to 0.73miwi2008-04-264-27/+412 * - Remove unneeded dependency from gtk12/gtk20 [1]miwi2008-04-201-1/+1 * - Remove USE_XLIB/USE_X_PREFIX/USE_XPM in favor of USE_XORGmiwi2008-03-261-2/+2 * Reset rainer.alves@gmail.com by request due to current lack of time tolinimon2007-06-301-1/+1 * - Welcome X.org 7.2 \o/.flz2007-05-201-0/+1 * Add WITHOUT_IPV6 knob (translates to --disable-ipv6).koitsu2007-02-211-0/+4 * - Fix ipv6 supportmiwi2006-11-081-0/+13 * - Update to 0.72miwi2006-11-074-66/+9 * - Update to 0.71erwin2006-05-055-16/+77 * Update from 0.69 to 0.70vd2006-04-214-63/+13 * Bump PORTREVISION on glib12/gtk12 consumer ports to ease the upgrade path.ade2006-03-071-1/+1 * SHA256ifyedwin2006-01-231-0/+1 * - Reset longtime inactive maintainerpav2005-12-091-1/+1 * - Fix duplicate entries for multi-path routerspav2005-12-092-5/+23 * Bump PORTREVISION to chase the glib20 shared library update.marcus2005-11-051-0/+1