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

Commit

Permalink
fix: Call extension AddPayload when receiving a block from Gossip
Browse files Browse the repository at this point in the history
The extension function, AddPayload, should be called so that it can apply custom logic when adding a block (payload).

closes #181

Signed-off-by: Bob Stasyszyn <[email protected]>
  • Loading branch information
bstasyszyn committed Apr 20, 2020
1 parent 8bc4d7f commit da133f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gossip/state/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ func (s *GossipStateProviderImpl) receiveAndQueueGossipMessages(ch <-chan *proto

dataMsg := msg.GetDataMsg()
if dataMsg != nil {
if err := s.addPayload(dataMsg.GetPayload(), nonBlocking); err != nil {
if err := s.extension.AddPayload(s.addPayload)(dataMsg.GetPayload(), s.blockingMode); err != nil {
logger.Warningf("Block [%d] received from gossip wasn't added to payload buffer: %v", dataMsg.Payload.SeqNum, err)
return
}
Expand Down

0 comments on commit da133f2

Please sign in to comment.