Skip to content

Commit

Permalink
Merge pull request #27 from kuba-4chain/feat/improve-txs-processing
Browse files Browse the repository at this point in the history
feat(peerHandler): process already found txs even when error is returned
  • Loading branch information
boecklim authored Jul 16, 2024
2 parents e8dc02b + 1b9fd90 commit 6e9795c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,8 @@ func (p *Peer) handleGetDataMsg(dataMsg *wire.MsgGetData, logger *slog.Logger) {
rawTxs, err := p.peerHandler.HandleTransactionsGet(txRequests, p)
if err != nil {
logger.Warn("Unable to fetch txs from store", slog.Int("count", len(txRequests)), slog.String(errKey, err.Error()))
return
// there is no return here because peerHandler.HandleTransactionsGet() may return
// already found rawTxs together with an error, so we want to process them
}

for _, txBytes := range rawTxs {
Expand Down

0 comments on commit 6e9795c

Please sign in to comment.