@@ -1518,7 +1518,7 @@ func (s *server) pushTxMsg(sp *serverPeer, hash *chainhash.Hash, doneChan chan<-
1518
1518
if encoding & wire .UtreexoEncoding == wire .UtreexoEncoding {
1519
1519
// If utreexo proof index is not present, we can't send the tx
1520
1520
// as we can't grab the proof for the tx.
1521
- if s .utreexoProofIndex == nil && s .flatUtreexoProofIndex == nil {
1521
+ if s .utreexoProofIndex == nil && s .flatUtreexoProofIndex == nil && ! cfg . Utreexo {
1522
1522
err := fmt .Errorf ("UtreexoProofIndex and FlatUtreexoProofIndex is nil. " +
1523
1523
"Cannot fetch utreexo accumulator proofs." )
1524
1524
srvrLog .Debugf (err .Error ())
@@ -1544,8 +1544,10 @@ func (s *server) pushTxMsg(sp *serverPeer, hash *chainhash.Hash, doneChan chan<-
1544
1544
// generate the UData.
1545
1545
if s .utreexoProofIndex != nil {
1546
1546
ud , err = s .utreexoProofIndex .GenerateUData (leafDatas )
1547
- } else {
1547
+ } else if s . flatUtreexoProofIndex != nil {
1548
1548
ud , err = s .flatUtreexoProofIndex .GenerateUData (leafDatas )
1549
+ } else {
1550
+ ud , err = s .chain .GenerateUData (leafDatas )
1549
1551
}
1550
1552
if err != nil {
1551
1553
chanLog .Errorf (err .Error ())
@@ -1575,7 +1577,7 @@ func (s *server) pushBlockMsg(sp *serverPeer, hash *chainhash.Hash, doneChan cha
1575
1577
1576
1578
// Early check to see if Utreexo proof index is there if UtreexoEncoding is given.
1577
1579
doUtreexo := encoding & wire .UtreexoEncoding == wire .UtreexoEncoding
1578
- if doUtreexo && s .utreexoProofIndex == nil && s .flatUtreexoProofIndex == nil {
1580
+ if doUtreexo && s .utreexoProofIndex == nil && s .flatUtreexoProofIndex == nil && ! cfg . Utreexo {
1579
1581
err := fmt .Errorf ("UtreexoProofIndex is nil. Cannot fetch utreexo accumulator proofs." )
1580
1582
peerLog .Tracef (err .Error ())
1581
1583
if doneChan != nil {
@@ -1616,7 +1618,7 @@ func (s *server) pushBlockMsg(sp *serverPeer, hash *chainhash.Hash, doneChan cha
1616
1618
}
1617
1619
1618
1620
// Fetch the Utreexo accumulator proof.
1619
- if doUtreexo {
1621
+ if doUtreexo && msgBlock . UData == nil {
1620
1622
var ud * wire.UData
1621
1623
1622
1624
// We already checked that at least one is active. Pick one and
0 commit comments