aboutsummaryrefslogtreecommitdiffstats
path: root/blockpool
diff options
context:
space:
mode:
authorzelig <viktor.tron@gmail.com>2015-04-08 19:43:55 +0800
committerzelig <viktor.tron@gmail.com>2015-04-09 20:58:35 +0800
commit262714fc6c269e0a3aa39892954b03db9418e649 (patch)
tree0d3ff6490f7df32b09f20c89c5900e0219759fe8 /blockpool
parentcbd0b42060d537d4d899b593be1ecd5ffdbd301a (diff)
downloaddexon-262714fc6c269e0a3aa39892954b03db9418e649.tar
dexon-262714fc6c269e0a3aa39892954b03db9418e649.tar.gz
dexon-262714fc6c269e0a3aa39892954b03db9418e649.tar.bz2
dexon-262714fc6c269e0a3aa39892954b03db9418e649.tar.lz
dexon-262714fc6c269e0a3aa39892954b03db9418e649.tar.xz
dexon-262714fc6c269e0a3aa39892954b03db9418e649.tar.zst
dexon-262714fc6c269e0a3aa39892954b03db9418e649.zip
future queued block support
- queued bool // flag for blockpool to skip TD check - set to true when future block queued - in checkTD: skip check if queued - TODO: add test (insertchain sets future block)
Diffstat (limited to 'blockpool')
-rw-r--r--blockpool/blockpool.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/blockpool/blockpool.go b/blockpool/blockpool.go
index d823d9898..e1891f5f4 100644
--- a/blockpool/blockpool.go
+++ b/blockpool/blockpool.go
@@ -782,7 +782,8 @@ LOOP:
// check if block's actual TD (calculated after successful insertChain) is identical to TD advertised for peer's head block.
func (self *BlockPool) checkTD(nodes ...*node) {
for _, n := range nodes {
- if n.td != nil {
+ // skip check if queued future block
+ if n.td != nil && !n.block.Queued() {
plog.DebugDetailf("peer td %v =?= block td %v", n.td, n.block.Td)
if n.td.Cmp(n.block.Td) != 0 {
self.peers.peerError(n.blockBy, ErrIncorrectTD, "on block %x", n.hash)