Branch: refs/heads/master
Home: https://github.com/btcsuite/btcd
Commit: 1bf564d96365856d623da13beb1d99aff3f92264
https://github.com/btcsuite/btcd/commit/1bf564d96365856d623da13beb1d99aff3f92264
Author: Olaoluwa Osuntokun <[email protected]>
Date: 2015-04-01 (Wed, 01 Apr 2015)
Changed paths:
M blockchain/accept.go
M blockchain/validate.go
M blockmanager.go
M docs/json_rpc_api.md
M peer.go
M server.go
Log Message:
-----------
Fix #138 by dynamically updating heights of peers
In order to avoid prior situations of stalled syncs due to
outdated peer height data, we now update block heights up peers in
real-time as we learn of their announced
blocks.
Updates happen when:
* A peer sends us an orphan block. We update based on
the height embedded in the scriptSig for the coinbase tx
* When a peer sends us an inv for a block we already know
of
* When peers announce new blocks. Subsequent
announcements that lost the announcement race are
recognized and peer heights are updated accordingly
Additionally, the `getpeerinfo` command has been modified
to include both the starting height, and current height of
connected peers.
Docs have been updated with `getpeerinfo` extension.