internal/ethapi: add mutex around signing + nonce assignment
This prevents concurrent assignment of identical nonces when automatic assignment is used.
This commit is contained in:
committed by
Felix Lange
parent
07aae19e5d
commit
ea11f7dd7a
@ -73,6 +73,7 @@ type State interface {
|
||||
}
|
||||
|
||||
func GetAPIs(apiBackend Backend) []rpc.API {
|
||||
nonceLock := new(AddrLocker)
|
||||
return []rpc.API{
|
||||
{
|
||||
Namespace: "eth",
|
||||
@ -87,7 +88,7 @@ func GetAPIs(apiBackend Backend) []rpc.API {
|
||||
}, {
|
||||
Namespace: "eth",
|
||||
Version: "1.0",
|
||||
Service: NewPublicTransactionPoolAPI(apiBackend),
|
||||
Service: NewPublicTransactionPoolAPI(apiBackend, nonceLock),
|
||||
Public: true,
|
||||
}, {
|
||||
Namespace: "txpool",
|
||||
@ -111,7 +112,7 @@ func GetAPIs(apiBackend Backend) []rpc.API {
|
||||
}, {
|
||||
Namespace: "personal",
|
||||
Version: "1.0",
|
||||
Service: NewPrivateAccountAPI(apiBackend),
|
||||
Service: NewPrivateAccountAPI(apiBackend, nonceLock),
|
||||
Public: false,
|
||||
},
|
||||
}
|
||||
|
Reference in New Issue
Block a user