mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
swarm/swap: bug fixes
This commit is contained in:
parent
f5d736d107
commit
24cc67cc07
1 changed files with 2 additions and 2 deletions
|
|
@ -139,7 +139,7 @@ func (dpo *DefaultPriceOracle) IsAccountedMsg(event *p2p.PeerEvent) bool {
|
||||||
if protoPriceMap, ok := dpo.priceMatrix[event.Protocol]; !ok {
|
if protoPriceMap, ok := dpo.priceMatrix[event.Protocol]; !ok {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if msgCode, ok := protoPriceMatrix[event.MsgCode]; !ok {
|
if msgCode, ok := protoPriceMap[event.MsgCode]; !ok {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
|
|
@ -190,7 +190,7 @@ func (s *Swap) AccountMsgForPeer(event *p2p.PeerEvent) {
|
||||||
price, direction := s.priceOracle.GetPriceForMsg(event)
|
price, direction := s.priceOracle.GetPriceForMsg(event)
|
||||||
if price == nil {
|
if price == nil {
|
||||||
//TODO what to do in this case? Should not happen
|
//TODO what to do in this case? Should not happen
|
||||||
panic("This should be accounted for but somehow it failed")
|
log.Crit("Price is nil; this should have been accounted for but somehow it failed")
|
||||||
}
|
}
|
||||||
|
|
||||||
if direction == ChargeSender {
|
if direction == ChargeSender {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue