Skip to content

Commit 6d4c8ba

Browse files
authored
fix: origin credit in replication (ethersphere#2127)
1 parent f1fa3b4 commit 6d4c8ba

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/pushsync/pushsync.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ func (ps *PushSync) pushToClosest(ctx context.Context, ch swarm.Chunk, retryAllo
308308
return true, false, nil
309309
}
310310
count++
311-
go ps.pushToNeighbour(peer, ch)
311+
go ps.pushToNeighbour(peer, ch, retryAllowed)
312312
return false, false, nil
313313
})
314314
return nil, err
@@ -433,7 +433,7 @@ func (ps *PushSync) pushPeer(ctx context.Context, peer swarm.Address, ch swarm.C
433433
}
434434

435435
// pushToNeighbour handles in-neighborhood replication for a single peer.
436-
func (ps *PushSync) pushToNeighbour(peer swarm.Address, ch swarm.Chunk) {
436+
func (ps *PushSync) pushToNeighbour(peer swarm.Address, ch swarm.Chunk, origin bool) {
437437
var err error
438438
defer func() {
439439
if err != nil {
@@ -496,7 +496,7 @@ func (ps *PushSync) pushToNeighbour(peer swarm.Address, ch swarm.Chunk) {
496496
return
497497
}
498498

499-
err = ps.accounting.Credit(peer, receiptPrice, false)
499+
err = ps.accounting.Credit(peer, receiptPrice, origin)
500500
}
501501

502502
type peerSkipList struct {

0 commit comments

Comments
 (0)