I think this fixes all sync problems
add a bool to the HashAndHeight struct; can indicate "final". When the block market final comes in, we don't enter wait state, but instead ask for headers. when you don't get any headers, you wont need any blocks, and that will assert the wait state.
This commit is contained in:
1 parent
27def9b623
commit
9eccb0638a
3 files changed
+74
-104
No files matched your search
@@ -69,7 +69,7 @@ func shell() {
|
||||
}
|
||||
|
||||
// once we're connected, initiate headers sync
|
||||
err = Hdr()
|
||||
err = SCon.AskForHeaders()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
@@ -149,18 +149,6 @@ func Shellparse(cmdslice []string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Hdr asks for headers.
|
||||
func Hdr() error {
|
||||
if SCon.RBytes == 0 {
|
||||
return fmt.Errorf("No SPV connection, can't get headers.")
|
||||
}
|
||||
err := SCon.AskForHeaders()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Bal prints out your score.
|
||||
func Bal(args []string) error {
|
||||
if SCon.TS == nil {
|
||||
|
||||
Reference in new issue
Block a user