Merge branch 'develop' into bounty

release/1.0.1
obscuren 10 years ago
commit c924a841c7
  1. 2
      core/chain_manager.go
  2. 7
      crypto/secp256k1/secp256.go
  3. 8
      p2p/server.go
  4. 6
      rpc/args.go
  5. 2
      rpc/http/server.go
  6. 8
      rpc/packages.go

@ -168,7 +168,7 @@ func (bc *ChainManager) NewBlock(coinbase []byte) *types.Block {
var root []byte
parentHash := ZeroHash256
if bc.CurrentBlock != nil {
if bc.currentBlock != nil {
root = bc.currentBlock.Header().Root
parentHash = bc.lastBlockHash
}

@ -15,8 +15,9 @@ import "C"
import (
"bytes"
"errors"
"github.com/ethereum/go-ethereum/crypto/randentropy"
"unsafe"
"github.com/ethereum/go-ethereum/crypto/randentropy"
)
//#define USE_FIELD_5X64
@ -85,6 +86,10 @@ func GenerateKeyPair() ([]byte, []byte) {
}
func GeneratePubKey(seckey []byte) ([]byte, error) {
if err := VerifySeckeyValidity(seckey); err != nil {
return nil, err
}
pubkey_len := C.int(65)
const seckey_len = 32

@ -436,15 +436,15 @@ func (self *BlacklistMap) Exists(pubkey []byte) (ok bool) {
}
func (self *BlacklistMap) Put(pubkey []byte) error {
self.lock.RLock()
defer self.lock.RUnlock()
self.lock.Lock()
defer self.lock.Unlock()
self.blacklist[string(pubkey)] = true
return nil
}
func (self *BlacklistMap) Delete(pubkey []byte) error {
self.lock.RLock()
defer self.lock.RUnlock()
self.lock.Lock()
defer self.lock.Unlock()
delete(self.blacklist, string(pubkey))
return nil
}

@ -43,7 +43,7 @@ type PushTxArgs struct {
func (obj *PushTxArgs) UnmarshalJSON(b []byte) (err error) {
arg0 := ""
if err = json.Unmarshal(b, arg0); err == nil {
if err = json.Unmarshal(b, &arg0); err == nil {
obj.Tx = arg0
return
}
@ -82,7 +82,7 @@ type GetStateArgs struct {
func (obj *GetStateArgs) UnmarshalJSON(b []byte) (err error) {
arg0 := ""
if err = json.Unmarshal(b, arg0); err == nil {
if err = json.Unmarshal(b, &arg0); err == nil {
obj.Address = arg0
return
}
@ -114,7 +114,7 @@ type GetTxCountArgs struct {
func (obj *GetTxCountArgs) UnmarshalJSON(b []byte) (err error) {
arg0 := ""
if err = json.Unmarshal(b, arg0); err == nil {
if err = json.Unmarshal(b, &arg0); err == nil {
obj.Address = arg0
return
}

@ -30,7 +30,7 @@ var rpchttplogger = logger.NewLogger("RPC-HTTP")
var JSON rpc.JsonWrapper
func NewRpcHttpServer(pipe *xeth.XEth, port int) (*RpcHttpServer, error) {
sport := fmt.Sprintf(":%d", port)
sport := fmt.Sprintf("127.0.0.1:%d", port)
l, err := net.Listen("tcp", sport)
if err != nil {
return nil, err

@ -109,8 +109,8 @@ func (self *EthereumApi) NewFilterString(args string, reply *interface{}) error
}
func (self *EthereumApi) FilterChanged(id int, reply *interface{}) error {
self.logMut.RLock()
defer self.logMut.RUnlock()
self.logMut.Lock()
defer self.logMut.Unlock()
*reply = toLogs(self.logs[id])
@ -309,8 +309,8 @@ func (p *EthereumApi) NewWhisperFilter(args *xeth.Options, reply *interface{}) e
}
func (self *EthereumApi) MessagesChanged(id int, reply *interface{}) error {
self.messagesMut.RLock()
defer self.messagesMut.RUnlock()
self.messagesMut.Lock()
defer self.messagesMut.Unlock()
*reply = self.messages[id]

Loading…
Cancel
Save