Skip to content
This repository has been archived by the owner on Apr 5, 2024. It is now read-only.

Commit

Permalink
Check if bundle is still valid before dispatching
Browse files Browse the repository at this point in the history
Fixes #13
  • Loading branch information
CryptoCopter authored and oxzi committed Aug 28, 2019
1 parent ee62d62 commit c556a66
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion core/processing.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,16 @@ func (c *Core) dispatching(bp BundlePack) {
return
}

if c.HasEndpoint(bp.MustBundle().PrimaryBlock.Destination) {
bndl, err := bp.Bundle()
if err != nil {
log.WithFields(log.Fields{
"bundleID": bp.Id,
"error": err.Error(),
}).Warn("Error dispatching bundle")
return
}

if c.HasEndpoint(bndl.PrimaryBlock.Destination) {
c.localDelivery(bp)
} else {
c.forward(bp)
Expand Down

0 comments on commit c556a66

Please sign in to comment.