Propagate known transactions to new peers on connect
This commit is contained in:
@ -214,7 +214,7 @@ type FilterOptions struct {
|
||||
Earliest int64
|
||||
Latest int64
|
||||
Address string
|
||||
Topics []string
|
||||
Topic []string
|
||||
Skip int
|
||||
Max int
|
||||
}
|
||||
@ -224,8 +224,8 @@ func toFilterOptions(options *FilterOptions) core.FilterOptions {
|
||||
opts.Earliest = options.Earliest
|
||||
opts.Latest = options.Latest
|
||||
opts.Address = fromHex(options.Address)
|
||||
opts.Topics = make([][]byte, len(options.Topics))
|
||||
for i, topic := range options.Topics {
|
||||
opts.Topics = make([][]byte, len(options.Topic))
|
||||
for i, topic := range options.Topic {
|
||||
opts.Topics[i] = fromHex(topic)
|
||||
}
|
||||
|
||||
|
@ -206,7 +206,7 @@ func (req *RpcRequest) ToFilterArgs() (*FilterOptions, error) {
|
||||
if len(req.Params) < 1 {
|
||||
return nil, NewErrorResponse(ErrorArguments)
|
||||
}
|
||||
fmt.Println("filter params", req.Params)
|
||||
fmt.Println("FILTER PARAMS", string(req.Params[0]))
|
||||
|
||||
args := new(FilterOptions)
|
||||
r := bytes.NewReader(req.Params[0])
|
||||
|
@ -70,6 +70,7 @@ func NewEthereumApi(eth *xeth.XEth) *EthereumApi {
|
||||
func (self *EthereumApi) NewFilter(args *FilterOptions, reply *interface{}) error {
|
||||
var id int
|
||||
filter := core.NewFilter(self.xeth.Backend())
|
||||
filter.SetOptions(toFilterOptions(args))
|
||||
filter.LogsCallback = func(logs state.Logs) {
|
||||
self.logMut.Lock()
|
||||
defer self.logMut.Unlock()
|
||||
|
Reference in New Issue
Block a user