piotrnar / gocoin

Full bitcoin solution written in Go (golang)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

panic in network.LimitRejectedSize()

piotrnar opened this issue · comments

Panic seen:

> main panic recovered: runtime error: invalid memory address or nil pointer dereference
goroutine 1 [running]:
runtime/debug.Stack(0xd90dc0, 0xc000010018, 0xc1efef94b8)
        /usr/local/go/src/runtime/debug/stack.go:24 +0x9d
main.main.func1()
        /home/piotr/GOPATH/src/github.com/piotrnar/gocoin/client/main.go:282 +0x137
panic(0x7fda20, 0x10fa230)
        /usr/local/go/src/runtime/panic.go:522 +0x1b5
github.com/piotrnar/gocoin/client/network.LimitRejectedSize()
        /home/piotr/GOPATH/src/github.com/piotrnar/gocoin/client/network/txpool_sort.go:206 +0x135
github.com/piotrnar/gocoin/client/network.RejectTx(0xc1fb292120, 0xc000c325d5, 0xd5b1bb53dc3165ba)
        /home/piotr/GOPATH/src/github.com/piotrnar/gocoin/client/network/txpool_core.go:193 +0x11a
github.com/piotrnar/gocoin/client/network.(*OneTxToSend).Delete(0xc15a3a5ad0, 0xc12c1cd500)
        /home/piotr/GOPATH/src/github.com/piotrnar/gocoin/client/network/txpool_core.go:607 +0x271
github.com/piotrnar/gocoin/client/network.HandleNetTx(0xc0d4298300, 0x0, 0x1008e00)
        /home/piotr/GOPATH/src/github.com/piotrnar/gocoin/client/network/txpool_core.go:496 +0x1997
main.main()
        /home/piotr/GOPATH/src/github.com/piotrnar/gocoin/client/main.go:470 +0xb94


Decoded callstack:

Started in HandleNetTx() for RFB tx, then going trhough replaced transaction calling:

for ctx, _ := range rbf_tx_list {
  ctx.Delete(false, TX_REJECTED_REPLACED)
}


... RejectTx(tx.Tx, reason)
... LimitRejectedSize() -  crashed here at: deleteRejected(sorted[idx].Hash.BIdx())

Will add some extra debugs and try to reproduce.

Can't reproduce. Will monitor...

Unable to reproduce or explain. Will assume a compiler bug at this moment. If ever happens again, will reopen.

To reproduce:

  1. Limit mempool size/count so the limit kicks in.

  2. Trigger getting MP from a friend peer.