Browse Source

Fix fix -- ignore cb if mempool broadcastTx cb is nil

pull/192/head
Jae Kwon 9 years ago
parent
commit
a7523015f7
1 changed files with 6 additions and 4 deletions
  1. +6
    -4
      mempool/mempool.go

+ 6
- 4
mempool/mempool.go View File

@ -84,10 +84,12 @@ func (mem *Mempool) CheckTx(tx types.Tx, cb func(*tmsp.Response)) (err error) {
// CACHE
if _, exists := mem.cacheMap[string(tx)]; exists {
cb(&tmsp.Response{
Code: tmsp.CodeType_BadNonce, // TODO or duplicate tx
Log: "Duplicate transaction (ignored)",
})
if cb != nil {
cb(&tmsp.Response{
Code: tmsp.CodeType_BadNonce, // TODO or duplicate tx
Log: "Duplicate transaction (ignored)",
})
}
return nil
}
if mem.cacheList.Len() >= cacheSize {


Loading…
Cancel
Save