mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-02-07 06:44:16 +00:00
Return false when calling Chain.add on an orphan we already have
This commit is contained in:
parent
599d4a671c
commit
f3d9c02841
@ -225,9 +225,12 @@ public abstract class AbstractBlockChain {
|
||||
}
|
||||
// Quick check for duplicates to avoid an expensive check further down (in findSplit). This can happen a lot
|
||||
// when connecting orphan transactions due to the dumb brute force algorithm we use.
|
||||
if (block.equals(getChainHead().getHeader()) || (tryConnecting && orphanBlocks.containsKey(block.getHash()))) {
|
||||
if (block.equals(getChainHead().getHeader())) {
|
||||
return true;
|
||||
}
|
||||
if (tryConnecting && orphanBlocks.containsKey(block.getHash())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// If we want to verify transactions (ie we are running with full blocks), verify that block has transactions
|
||||
if (shouldVerifyTransactions() && block.transactions == null)
|
||||
|
Loading…
Reference in New Issue
Block a user