mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-02 01:53:48 +00:00
swarm/network;swarm/dev:fix new syncer bugs
This commit is contained in:
parent
73cc315638
commit
163cef750e
2 changed files with 5 additions and 5 deletions
|
|
@ -209,10 +209,12 @@ start_swarm_node() {
|
|||
--datadir "${dir}"
|
||||
--identity "${name}"
|
||||
--ens-api "${GETH_RPC_URL}"
|
||||
--httpaddr "${ip}"
|
||||
--bzznetworkid "321"
|
||||
--bzzaccount "${address}"
|
||||
--password "${dir}/password"
|
||||
--verbosity "6"
|
||||
--debug
|
||||
)
|
||||
|
||||
start_node "${name}" "${ip}" "$(which swarm)" ${args[@]}
|
||||
|
|
|
|||
|
|
@ -214,7 +214,7 @@ func newSyncer(
|
|||
*/
|
||||
if state.SessionAt == 0 {
|
||||
log.Trace(fmt.Sprintf("syncer[%v]: nothing to sync", self.key.Log()))
|
||||
return self, nil
|
||||
// return self, nil
|
||||
}
|
||||
log.Trace(fmt.Sprintf("syncer[%v]: start replaying stale requests from request db", self.key.Log()))
|
||||
for p := priorities - 1; p >= 0; p-- {
|
||||
|
|
@ -369,7 +369,7 @@ func (self *syncer) sendUnsyncedKeys() {
|
|||
func (self *syncer) syncUnsyncedKeys() {
|
||||
// send out new
|
||||
var unsynced []*syncRequest
|
||||
var more, justSynced bool
|
||||
var more bool
|
||||
var keyCount, historyCnt int
|
||||
|
||||
priority := High
|
||||
|
|
@ -426,9 +426,8 @@ LOOP:
|
|||
// * batch full OR
|
||||
// * all history have been consumed, synced)
|
||||
if deliveryRequest == nil &&
|
||||
(justSynced && len(unsynced) > 0 ||
|
||||
(keys == nil && len(unsynced) > 0 ||
|
||||
len(unsynced) == int(self.SyncBatchSize)) {
|
||||
justSynced = false
|
||||
// listen to requests
|
||||
deliveryRequest = self.deliveryRequest
|
||||
newUnsyncedKeys = nil // not care about data until next req comes in
|
||||
|
|
@ -455,7 +454,6 @@ LOOP:
|
|||
if keys == history && !more {
|
||||
log.Trace(fmt.Sprintf("syncer[%v]: syncing history segment complete", self.key.Log()))
|
||||
// moved to closing of channel in syncHistory
|
||||
justSynced = true
|
||||
|
||||
log.Trace(fmt.Sprintf("syncer[%v]: start synchronising history since last disconnect at %v up until session start at %v: %v", self.key.Log(), state.Last, state.SessionAt, state))
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue