oh right, another fun thing I forgot about
When there's only the coinbase tx, the merkle root = the coinbase txid. Needless complication in bitcoin == job security?
This commit is contained in:
parent
7dbf4a4a4f
commit
709b8a05cd
@ -77,9 +77,6 @@ func checkMBlock(m *wire.MsgMerkleBlock) ([]*wire.ShaHash, error) {
|
|||||||
if len(m.Flags) == 0 {
|
if len(m.Flags) == 0 {
|
||||||
return nil, fmt.Errorf("No flag bits")
|
return nil, fmt.Errorf("No flag bits")
|
||||||
}
|
}
|
||||||
if len(m.Hashes) < 2 { // nothing but the merkle root
|
|
||||||
return nil, nil // nothin.
|
|
||||||
}
|
|
||||||
var s []merkleNode // the stack
|
var s []merkleNode // the stack
|
||||||
var r []*wire.ShaHash // slice to return; txids we care about
|
var r []*wire.ShaHash // slice to return; txids we care about
|
||||||
|
|
||||||
|
@ -5,6 +5,8 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
|
"li.lan/labs/uwallet"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/wire"
|
"github.com/btcsuite/btcd/wire"
|
||||||
"github.com/btcsuite/btcutil"
|
"github.com/btcsuite/btcutil"
|
||||||
"github.com/btcsuite/btcutil/bloom"
|
"github.com/btcsuite/btcutil/bloom"
|
||||||
@ -72,6 +74,7 @@ func (t *TxStore) IngestTx(tx *wire.MsgTx) error {
|
|||||||
inTxid := tx.TxSha()
|
inTxid := tx.TxSha()
|
||||||
height, ok := t.OKTxids[inTxid]
|
height, ok := t.OKTxids[inTxid]
|
||||||
if !ok {
|
if !ok {
|
||||||
|
log.Printf("False postive tx? %s", uwallet.TxToString(tx))
|
||||||
return fmt.Errorf("we don't care about tx %s", inTxid.String())
|
return fmt.Errorf("we don't care about tx %s", inTxid.String())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user