mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 20:56:42 +00:00
Changed rlp structures from int64 to uint64
This commit is contained in:
parent
07993aa2ea
commit
6ef20e84cf
2 changed files with 16 additions and 16 deletions
|
|
@ -88,11 +88,11 @@ func (self *NetStore) addStoreRequest(req *storeRequestMsgData) {
|
||||||
chunk = &Chunk{
|
chunk = &Chunk{
|
||||||
Key: req.Key,
|
Key: req.Key,
|
||||||
Data: req.Data,
|
Data: req.Data,
|
||||||
Size: req.Size,
|
Size: int64(req.Size),
|
||||||
}
|
}
|
||||||
} else if chunk.Data == nil {
|
} else if chunk.Data == nil {
|
||||||
chunk.Data = req.Data
|
chunk.Data = req.Data
|
||||||
chunk.Size = req.Size
|
chunk.Size = int64(req.Size)
|
||||||
} else {
|
} else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
@ -152,7 +152,7 @@ func (self *NetStore) addRetrieveRequest(req *retrieveRequestMsgData) {
|
||||||
// we might need chunk.req to cache relevant peers response, or would it expire?
|
// we might need chunk.req to cache relevant peers response, or would it expire?
|
||||||
self.peers(req, chunk, *timeout)
|
self.peers(req, chunk, *timeout)
|
||||||
if timeout != nil {
|
if timeout != nil {
|
||||||
self.startSearch(chunk, req.Id, *timeout)
|
self.startSearch(chunk, int64(req.Id), *timeout)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -164,7 +164,7 @@ func (self *NetStore) startSearch(chunk *Chunk, id int64, timeout time.Time) {
|
||||||
peers := self.hive.getPeers(chunk.Key)
|
peers := self.hive.getPeers(chunk.Key)
|
||||||
req := &retrieveRequestMsgData{
|
req := &retrieveRequestMsgData{
|
||||||
Key: chunk.Key,
|
Key: chunk.Key,
|
||||||
Id: id,
|
Id: uint64(id),
|
||||||
Timeout: timeout,
|
Timeout: timeout,
|
||||||
}
|
}
|
||||||
for _, peer := range peers {
|
for _, peer := range peers {
|
||||||
|
|
@ -183,8 +183,8 @@ only add if less than requesterCount peers forwarded the same request id so far
|
||||||
note this is done irrespective of status (searching or found/timedOut)
|
note this is done irrespective of status (searching or found/timedOut)
|
||||||
*/
|
*/
|
||||||
func (self *NetStore) addRequester(rs *requestStatus, req *retrieveRequestMsgData) {
|
func (self *NetStore) addRequester(rs *requestStatus, req *retrieveRequestMsgData) {
|
||||||
list := rs.requesters[req.Id]
|
list := rs.requesters[int64(req.Id)]
|
||||||
rs.requesters[req.Id] = append(list, req)
|
rs.requesters[int64(req.Id)] = append(list, req)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -220,8 +220,8 @@ func (self *NetStore) propagateResponse(chunk *Chunk) {
|
||||||
msg := &storeRequestMsgData{
|
msg := &storeRequestMsgData{
|
||||||
Key: chunk.Key,
|
Key: chunk.Key,
|
||||||
Data: chunk.Data,
|
Data: chunk.Data,
|
||||||
Size: chunk.Size,
|
Size: uint64(chunk.Size),
|
||||||
Id: id,
|
Id: uint64(id),
|
||||||
}
|
}
|
||||||
for _, req := range requesters {
|
for _, req := range requesters {
|
||||||
if req.Timeout.After(time.Now()) {
|
if req.Timeout.After(time.Now()) {
|
||||||
|
|
@ -240,7 +240,7 @@ func (self *NetStore) deliver(req *retrieveRequestMsgData, chunk *Chunk) {
|
||||||
Key: req.Key,
|
Key: req.Key,
|
||||||
Id: req.Id,
|
Id: req.Id,
|
||||||
Data: chunk.Data,
|
Data: chunk.Data,
|
||||||
Size: chunk.Size,
|
Size: uint64(chunk.Size),
|
||||||
RequestTimeout: req.Timeout, //
|
RequestTimeout: req.Timeout, //
|
||||||
// StorageTimeout time.Time // expiry of content
|
// StorageTimeout time.Time // expiry of content
|
||||||
// Metadata metaData
|
// Metadata metaData
|
||||||
|
|
@ -253,8 +253,8 @@ func (self *NetStore) store(chunk *Chunk) {
|
||||||
req := &storeRequestMsgData{
|
req := &storeRequestMsgData{
|
||||||
Key: chunk.Key,
|
Key: chunk.Key,
|
||||||
Data: chunk.Data,
|
Data: chunk.Data,
|
||||||
Id: id,
|
Id: uint64(id),
|
||||||
Size: chunk.Size,
|
Size: uint64(chunk.Size),
|
||||||
}
|
}
|
||||||
for _, peer := range self.hive.getPeers(chunk.Key) {
|
for _, peer := range self.hive.getPeers(chunk.Key) {
|
||||||
go peer.store(req)
|
go peer.store(req)
|
||||||
|
|
|
||||||
|
|
@ -74,10 +74,10 @@ type statusMsgData struct {
|
||||||
*/
|
*/
|
||||||
type storeRequestMsgData struct {
|
type storeRequestMsgData struct {
|
||||||
Key Key // hash of datasize | data
|
Key Key // hash of datasize | data
|
||||||
Size int64 // size of data in bytes
|
Size uint64 // size of data in bytes
|
||||||
Data []byte // is this needed?
|
Data []byte // is this needed?
|
||||||
// optional
|
// optional
|
||||||
Id int64 //
|
Id uint64 //
|
||||||
RequestTimeout time.Time // expiry for forwarding
|
RequestTimeout time.Time // expiry for forwarding
|
||||||
StorageTimeout time.Time // expiry of content
|
StorageTimeout time.Time // expiry of content
|
||||||
Metadata metaData //
|
Metadata metaData //
|
||||||
|
|
@ -95,8 +95,8 @@ It is unclear if a retrieval request with an empty target is the same as a self
|
||||||
type retrieveRequestMsgData struct {
|
type retrieveRequestMsgData struct {
|
||||||
Key Key
|
Key Key
|
||||||
// optional
|
// optional
|
||||||
Id int64 //
|
Id uint64 //
|
||||||
MaxSize int64 // maximum size of delivery accepted
|
MaxSize uint64 // maximum size of delivery accepted
|
||||||
Timeout time.Time //
|
Timeout time.Time //
|
||||||
Metadata metaData //
|
Metadata metaData //
|
||||||
//
|
//
|
||||||
|
|
@ -121,7 +121,7 @@ type peersMsgData struct {
|
||||||
Peers []*peerAddr //
|
Peers []*peerAddr //
|
||||||
Timeout time.Time // indicate whether responder is expected to deliver content
|
Timeout time.Time // indicate whether responder is expected to deliver content
|
||||||
Key Key // if a response to a retrieval request
|
Key Key // if a response to a retrieval request
|
||||||
Id int64 // if a response to a retrieval request
|
Id uint64 // if a response to a retrieval request
|
||||||
//
|
//
|
||||||
peer peer
|
peer peer
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue