diff options
author | obscuren <geffobscura@gmail.com> | 2015-04-18 08:24:24 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-04-18 08:24:24 +0800 |
commit | ecc74d76ccf8fe4ca8c32120697d64845c475169 (patch) | |
tree | ab56fb80fa9a55270005a19db65573671608690a | |
parent | cc436c4b28c95f825499d67c92a18de5d27e90c2 (diff) | |
download | dexon-ecc74d76ccf8fe4ca8c32120697d64845c475169.tar.gz dexon-ecc74d76ccf8fe4ca8c32120697d64845c475169.tar.zst dexon-ecc74d76ccf8fe4ca8c32120697d64845c475169.zip |
eth: drop blocks that are known
-rw-r--r-- | eth/handler.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/eth/handler.go b/eth/handler.go index 858ae2958..065116fd0 100644 --- a/eth/handler.go +++ b/eth/handler.go @@ -256,6 +256,12 @@ func (self *ProtocolManager) handleMsg(p *peer) error { RemoteId: p.ID().String(), }) + // Make sure the block isn't already known. If this is the case simply drop + // the message and move on. + if self.chainman.HasBlock(hash) { + break + } + // Attempt to insert the newly received by checking if the parent exists. // if the parent exists we process the block and propagate to our peers // if the parent does not exists we delegate to the downloader. |