dogecoinfoundation / libdogecoin

Libdogecoin provides low level C functions useful for building compliant Dogecoin Nodes & Wallets.
MIT License
110 stars 24 forks source link

spv: optimize initial block download #194

Closed xanimo closed 9 months ago

xanimo commented 9 months ago

-constrain processing of inv messages to only those that are 500 or greater in length during ibd -only call getblocks when node->last_requested_inv is equal to pindex->hash -aggressively disconnect from peers who are non responsive longer than that of HEADERS_MAX_RESPONSE_TIME -change HEADERS_MAX_RESPONSE_TIME to 2 minutes which is reflective of parameters set in core -change BLOCKS_DELTA_IN_S to 60 (1 dogecoin mined per minute) which is proportionally representative of the original value of 600 or 10 minutes per bitcoin mined -compare chaintip->height with node->bestknownheight instead of chaintip->header.timestamp > client->oldest_item_of_interest - (BLOCK_GAP_TO_DEDUCT_TO_START_SCAN_FROM * BLOCKS_DELTA_IN_S) for calling sync_completed -conditionally call dogecoin_net_spv_node_request_headers_or_blocks if we're within 2 days from the tip -add support to check for pubkey, pubkeyhash, scripthash and multisig in dogecoin_wallet_txout_is_mine -check both dogecoin_wallet_is_mine and dogecoin_wallet_is_from_me in dogecoin_wallet_check_transaction -add back maxnodes configuration option to spvnode and use that in spvnode.py tests -return after freeing tx and disconnecting the tip on dogecoin_tx_deserialize failure -add stdio.h and use %Y-%m-%d %H:%M:%S instead of %F %T in strftime for NULL ctime_no_newline on i686-w64-mingw32

edtubbs commented 9 months ago

reACK, rebase confirmed correct.