aboutsummaryrefslogtreecommitdiffstats
path: root/rpc
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-02-18 05:20:47 +0800
committerobscuren <geffobscura@gmail.com>2015-02-18 05:20:47 +0800
commit7fc9b5b3f9ca0111cc4bc1b2a6b4bb2eccd3e048 (patch)
tree764d7ebd57cafbae0a12d046aeafd1b823a0f0bb /rpc
parent11e12680ebe4f4679083317ee0f2c27b219d44b3 (diff)
downloaddexon-7fc9b5b3f9ca0111cc4bc1b2a6b4bb2eccd3e048.tar.gz
dexon-7fc9b5b3f9ca0111cc4bc1b2a6b4bb2eccd3e048.tar.zst
dexon-7fc9b5b3f9ca0111cc4bc1b2a6b4bb2eccd3e048.zip
Changed to ChainEvent and fixed a nil pointer in transact
Diffstat (limited to 'rpc')
-rw-r--r--rpc/args.go29
-rw-r--r--rpc/packages.go6
2 files changed, 35 insertions, 0 deletions
diff --git a/rpc/args.go b/rpc/args.go
index 9c2c7d7a6..429b385d5 100644
--- a/rpc/args.go
+++ b/rpc/args.go
@@ -38,6 +38,35 @@ type NewTxArgs struct {
Data string `json:"data"`
}
+func (obj *NewTxArgs) UnmarshalJSON(b []byte) (err error) {
+ // Data can be either specified as "data" or "code" :-/
+ var ext struct {
+ From string
+ To string
+ Value string
+ Gas string
+ GasPrice string
+ Data string
+ Code string
+ }
+
+ if err = json.Unmarshal(b, &ext); err == nil {
+ if len(ext.Data) == 0 {
+ ext.Data = ext.Code
+ }
+ obj.From = ext.From
+ obj.To = ext.To
+ obj.Value = ext.Value
+ obj.Gas = ext.Gas
+ obj.GasPrice = ext.GasPrice
+ obj.Data = ext.Data
+
+ return
+ }
+
+ return NewErrorResponse(ErrorDecodeArgs)
+}
+
type PushTxArgs struct {
Tx string `json:"tx"`
}
diff --git a/rpc/packages.go b/rpc/packages.go
index 0b73d48a7..4d2194571 100644
--- a/rpc/packages.go
+++ b/rpc/packages.go
@@ -127,6 +127,9 @@ func (self *EthereumApi) NewFilterString(args string, reply *interface{}) error
filter := core.NewFilter(self.xeth.Backend())
callback := func(block *types.Block) {
+ self.logMut.Lock()
+ defer self.logMut.Unlock()
+
self.logs[id] = append(self.logs[id], &state.StateLog{})
}
if args == "pending" {
@@ -153,6 +156,9 @@ func (self *EthereumApi) FilterChanged(id int, reply *interface{}) error {
}
func (self *EthereumApi) Logs(id int, reply *interface{}) error {
+ self.logMut.Lock()
+ defer self.logMut.Unlock()
+
filter := self.filterManager.GetFilter(id)
*reply = toLogs(filter.Find())
desktop.Maxim Sobolev2001-12-132-2/+32 * Add missed "@dirrm share/gnome/control-center/capplets".Maxim Sobolev2001-12-121-0/+1 * Update to 1.0.0.Maxim Sobolev2001-12-055-132/+10 * Update to 0.16.1.Maxim Sobolev2001-11-205-12/+159 * Update to 0.16.0.Maxim Sobolev2001-11-103-4/+6 * Chase increase of libgal shared library version number.Maxim Sobolev2001-10-091-1/+1 * Update to 0.14.0.Maxim Sobolev2001-10-093-4/+4 * Update to 0.13.0.Maxim Sobolev2001-10-013-5/+14 * Update to 0.12.0.Maxim Sobolev2001-09-113-11/+20 * Chase gal SHLIB version.Dmitry Sivachenko2001-08-261-1/+1 * Update version number of gal shared library.Maxim Sobolev2001-08-091-1/+1 * Update to 0.11.1.Maxim Sobolev2001-08-033-5/+33 * Delete ${PREFIX}/share/gnome/control-center/capplets directory on deinstall.Maxim Sobolev2001-08-022-0/+2 * Update to 0.10.0.Maxim Sobolev2001-07-233-5/+15 * Chase gal SHLIB version bump.Dmitry Sivachenko2001-07-131-1/+1 * Fold gtkhtml (and, by association, gal) into dependencies for x11/gnomecoreAde Lovett2001-06-191-2/+4 * Chase new shlib revision from x11-toolkits/galAde Lovett2001-05-221-1/+1 * SWitch maintainership of core GNOME ports to a small group ofAde Lovett2001-05-121-1/+1 * The new GNOME 1.4 "Fifth-Toe" metaport, bringing together a wholeAde Lovett2001-05-053-10/+9 * -pthread --> ${PTHREAD_LIBS}Maxim Sobolev2001-03-301-1/+1 * Add missing dependencyAde Lovett2001-03-121-0/+1 * Update for new x11-toolkits/gal shared library revisionAde Lovett2001-02-10