@@ -1010,7 +1010,7 @@ func (mp *TxPool) maybeAcceptTransaction(tx *btcutil.Tx, isNew, rateLimit,
1010
1010
1011
1011
// Check for mempool acceptance.
1012
1012
r , err := mp .checkMempoolAcceptance (
1013
- tx , isNew , rateLimit , rejectDupOrphans ,
1013
+ tx , nil , isNew , rateLimit , rejectDupOrphans ,
1014
1014
)
1015
1015
if err != nil {
1016
1016
return nil , nil , err
@@ -1314,13 +1314,19 @@ func (mp *TxPool) RawMempoolVerbose() map[string]*btcjson.GetRawMempoolVerboseRe
1314
1314
// input transactions can't be found for some reason.
1315
1315
tx := desc .Tx
1316
1316
var currentPriority float64
1317
- // Don't calculate for utreexo nodes yet.
1318
1317
if mp .cfg .IsUtreexoViewActive == nil && ! mp .cfg .IsUtreexoViewActive () {
1319
1318
utxos , err := mp .fetchInputUtxos (tx )
1320
1319
if err == nil {
1321
1320
currentPriority = mining .CalcPriority (tx .MsgTx (), utxos ,
1322
1321
bestHeight + 1 )
1323
1322
}
1323
+ } else {
1324
+ udata , found := mp .poolLeaves [* tx .Hash ()]
1325
+ if found {
1326
+ utxos := mp .fetchInputUtxosFromLeaves (tx , udata )
1327
+ currentPriority = mining .CalcPriority (tx .MsgTx (), utxos ,
1328
+ bestHeight + 1 )
1329
+ }
1324
1330
}
1325
1331
1326
1332
mpd := & btcjson.GetRawMempoolVerboseResult {
@@ -1399,7 +1405,7 @@ func (mp *TxPool) CheckMempoolAcceptance(tx *btcutil.Tx) (
1399
1405
// which has the effect that we always check the fee paid from this tx
1400
1406
// is greater than min relay fee. We also reject this tx if it's
1401
1407
// already an orphan.
1402
- result , err := mp .checkMempoolAcceptance (tx , true , true , true )
1408
+ result , err := mp .checkMempoolAcceptance (tx , nil , true , true , true )
1403
1409
if err != nil {
1404
1410
log .Errorf ("CheckMempoolAcceptance: %v" , err )
1405
1411
return nil , err
@@ -1414,7 +1420,7 @@ func (mp *TxPool) CheckMempoolAcceptance(tx *btcutil.Tx) (
1414
1420
// checkMempoolAcceptance performs a series of validations on the given
1415
1421
// transaction. It returns an error when the transaction fails to meet the
1416
1422
// mempool policy, otherwise a `mempoolAcceptResult` is returned.
1417
- func (mp * TxPool ) checkMempoolAcceptance (tx * btcutil.Tx ,
1423
+ func (mp * TxPool ) checkMempoolAcceptance (tx * btcutil.Tx , utreexoData * wire. UData ,
1418
1424
isNew , rateLimit , rejectDupOrphans bool ) (* MempoolAcceptResult , error ) {
1419
1425
1420
1426
txHash := tx .Hash ()
@@ -1478,12 +1484,10 @@ func (mp *TxPool) checkMempoolAcceptance(tx *btcutil.Tx,
1478
1484
}
1479
1485
1480
1486
var utxoView * blockchain.UtxoViewpoint
1481
- if mp .cfg .IsUtreexoViewActive != nil && mp .cfg .IsUtreexoViewActive () {
1482
- ud := tx .MsgTx ().UData
1483
-
1487
+ if utreexoData != nil && mp .cfg .IsUtreexoViewActive != nil && mp .cfg .IsUtreexoViewActive () {
1484
1488
// First verify the proof to ensure that the proof the peer has
1485
1489
// sent was over valid.
1486
- err = mp .cfg .VerifyUData (ud , tx .MsgTx ().TxIn , false )
1490
+ err = mp .cfg .VerifyUData (utreexoData , tx .MsgTx ().TxIn , false )
1487
1491
if err != nil {
1488
1492
str := fmt .Sprintf ("transaction %v failed the utreexo data verification. %v" ,
1489
1493
txHash , err )
@@ -1492,7 +1496,7 @@ func (mp *TxPool) checkMempoolAcceptance(tx *btcutil.Tx,
1492
1496
log .Debugf ("VerifyUData passed for tx %s" , txHash .String ())
1493
1497
1494
1498
// After the validation passes, turn that proof into a utxoView.
1495
- utxoView = mp .fetchInputUtxosFromLeaves (tx , ud .LeafDatas )
1499
+ utxoView = mp .fetchInputUtxosFromLeaves (tx , utreexoData .LeafDatas )
1496
1500
} else {
1497
1501
// Fetch all of the unspent transaction outputs referenced by the
1498
1502
// inputs to this transaction. This function also attempts to fetch the
0 commit comments