Update birthday related code #27
3 changed files with 6 additions and 9 deletions
|
@ -480,9 +480,7 @@ func birthdaySanityCheck(chainConn chainConn,
|
||||||
|
|
||||||
// Otherwise, we'll attempt to locate a better one now that we have
|
// Otherwise, we'll attempt to locate a better one now that we have
|
||||||
// access to the chain.
|
// access to the chain.
|
||||||
// To be on the safe side, scan 2 days past of the actual timestamp.
|
newBirthdayBlock, err := locateBirthdayBlock(chainConn, birthdayTimestamp)
|
||||||
bday := birthdayTimestamp.Add(48 * time.Hour)
|
|
||||||
newBirthdayBlock, err := locateBirthdayBlock(chainConn, bday)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ import (
|
||||||
const (
|
const (
|
||||||
// defaultBlockInterval is the default time interval between any two
|
// defaultBlockInterval is the default time interval between any two
|
||||||
// blocks in a mocked chain.
|
// blocks in a mocked chain.
|
||||||
defaultBlockInterval = 10 * time.Minute
|
defaultBlockInterval = 150 * time.Second
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -371,11 +371,10 @@ func (w *Wallet) syncWithChain(birthdayStamp *waddrmgr.BlockStamp) error {
|
||||||
|
|
||||||
// If we've yet to find our birthday block, we'll do so now.
|
// If we've yet to find our birthday block, we'll do so now.
|
||||||
if birthdayStamp == nil {
|
if birthdayStamp == nil {
|
||||||
|
var err error
|
||||||
// To be on the safe side, scan 2 days past of the actual
|
birthdayStamp, err = locateBirthdayBlock(
|
||||||
// timestamp.
|
chainClient, w.Manager.Birthday(),
|
||||||
bday := w.Manager.Birthday().Add(48 * time.Hour)
|
)
|
||||||
birthdayStamp, err = locateBirthdayBlock(chainClient, bday)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("unable to locate birthday block: %v",
|
return fmt.Errorf("unable to locate birthday block: %v",
|
||||||
err)
|
err)
|
||||||
|
|
Loading…
Reference in a new issue