bridge: bypass p2p for our own signatures

ghstack-source-id: ce2bbc780f
Pull Request resolved: https://github.com/certusone/wormhole/pull/60
This commit is contained in:
Leo 2020-10-28 22:41:34 +01:00
parent 45d10618ce
commit bdd9d96559
2 changed files with 8 additions and 6 deletions

View File

@ -223,12 +223,11 @@ func p2p(obsvC chan *gossipv1.LockupObservation, sendC chan []byte) func(ctx con
continue
}
// TODO: better way to handle our own sigs?
//if envl.GetFrom() == h.ID() {
// logger.Debug("received message from ourselves, ignoring",
// zap.Any("payload", msg.Message))
// continue
//}
if envl.GetFrom() == h.ID() {
logger.Debug("received message from ourselves, ignoring",
zap.Any("payload", msg.Message))
continue
}
logger.Debug("received message",
zap.Any("payload", msg.Message),

View File

@ -151,6 +151,9 @@ func vaaConsensusProcessor(lockC chan *common.ChainLock, setC chan *common.Guard
}
state.vaaSignatures[hash].ourVAA = v
// Fast path for our own signature
go func() { obsvC <- &obsv }()
case m := <-obsvC:
// SECURITY: at this point, observations received from the p2p network are fully untrusted (all fields!)
//