diff --git a/shell.go b/shell.go index 5eb8057b..365b0ac2 100644 --- a/shell.go +++ b/shell.go @@ -68,11 +68,11 @@ func shell() { } } - // once we're connected, initiate headers sync - // err = SCon.AskForHeaders() - // if err != nil { - // log.Fatal(err) - // } + // once we're connected, initiate headers sync + err = SCon.AskForHeaders() + if err != nil { + log.Fatal(err) + } // main shell loop for { diff --git a/uspv/eight333.go b/uspv/eight333.go index 533b87d6..ca88e18f 100644 --- a/uspv/eight333.go +++ b/uspv/eight333.go @@ -349,7 +349,7 @@ func (s *SPVCon) AskForBlocks() error { return nil } - fmt.Printf("will request merkleblocks %d to %d\n", dbTip, headerTip) + fmt.Printf("will request blocks %d to %d\n", dbTip, headerTip) if !s.HardMode { // don't send this in hardmode! that's the whole point // create initial filter diff --git a/uspv/hardmode.go b/uspv/hardmode.go index c5d99f5f..3e3bcdba 100644 --- a/uspv/hardmode.go +++ b/uspv/hardmode.go @@ -39,7 +39,7 @@ func (s *SPVCon) IngestBlock(m *wire.MsgBlock) { for i, tx := range m.Transactions { // if i > 0 { fmt.Printf("wtxid: %s\n", tx.WTxSha()) - fmt.Printf("txid: %s\n", tx.TxSha()) + fmt.Printf(" txid: %s\n", tx.TxSha()) fmt.Printf("%d %s", i, TxToString(tx)) // } } diff --git a/uspv/txstore.go b/uspv/txstore.go index ed6b555e..3881b485 100644 --- a/uspv/txstore.go +++ b/uspv/txstore.go @@ -133,8 +133,9 @@ func CheckDoubleSpends( // TxToString prints out some info about a transaction. for testing / debugging func TxToString(tx *wire.MsgTx) string { - str := fmt.Sprintf("\t size %d wsize %d Tx %s\n", - tx.SerializeSize(), tx.SerializeSizeWitness(), tx.TxSha().String()) + str := fmt.Sprintf("\t size %d vsize %d wsize %d Tx %s\n", + tx.SerializeSize(), tx.VirtualSize(), tx.SerializeSizeWitness(), + tx.TxSha().String()) for i, in := range tx.TxIn { str += fmt.Sprintf("Input %d: %s\n", i, in.PreviousOutPoint.String()) str += fmt.Sprintf("SigScript for input %d: %x\n", i, in.SignatureScript) @@ -148,7 +149,7 @@ func TxToString(tx *wire.MsgTx) string { } } for i, wit := range tx.TxWitness { - if wit.ScriptWitness != nil { + if wit != nil { str += fmt.Sprintf("Witness %d: %x\n", i, wit.ScriptWitness) } }