1, Fix issue #211, add detailed RevertToInv check.
2, Fix issue #224, send GetHeaders msg once, when pindexBestHeader is 24h near to now, which will let us know all available headers, and thus find most pow work header.
3, add support of pindexBestHeaderSent variable, which we do not implement in previous code. But this variable is needed to when fixing issue #211.
4, some old bug found and fixed.
All FT & UT run passed.
And I am testing these code on mainnet, until now everything goes well.
1, Fix issue #211, add detailed RevertToInv check. 2, Fix issue #224, send GetHeaders msg once, when pindexBestHeader is 24h near to now, which will let us know all available headers, and thus find most pow work header. 3, add support of pindexBestHeaderSent variable, which we do not implement in previous code. But this variable is needed to when fixing issue #211. 4, some old bug found and fixed.
All FT & UT run passed.
And I am testing these code on mainnet, until now everything goes well.
@whunmr please help review the code.