mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-11-28 16:13:56 +00:00
Don't remove redeemers and skip mempool full revalidation
This commit is contained in:
parent
c434022258
commit
3e5a436014
@ -4,7 +4,6 @@ import (
|
|||||||
"github.com/kaspanet/kaspad/domain/consensus/model/externalapi"
|
"github.com/kaspanet/kaspad/domain/consensus/model/externalapi"
|
||||||
"github.com/kaspanet/kaspad/domain/miningmanager/mempool/model"
|
"github.com/kaspanet/kaspad/domain/miningmanager/mempool/model"
|
||||||
"github.com/kaspanet/kaspad/infrastructure/logger"
|
"github.com/kaspanet/kaspad/infrastructure/logger"
|
||||||
"github.com/pkg/errors"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func (mp *mempool) revalidateHighPriorityTransactions() ([]*externalapi.DomainTransaction, error) {
|
func (mp *mempool) revalidateHighPriorityTransactions() ([]*externalapi.DomainTransaction, error) {
|
||||||
@ -101,27 +100,13 @@ func (mp *mempool) revalidateTransaction(transaction *model.MempoolTransaction)
|
|||||||
}
|
}
|
||||||
if len(missingParents) > 0 {
|
if len(missingParents) > 0 {
|
||||||
log.Debugf("Removing transaction %s, it failed revalidation", transaction.TransactionID())
|
log.Debugf("Removing transaction %s, it failed revalidation", transaction.TransactionID())
|
||||||
err := mp.removeTransaction(transaction.TransactionID(), true)
|
err := mp.removeTransaction(transaction.TransactionID(), false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
return false, err
|
||||||
}
|
}
|
||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = mp.validateAndInsertTransaction(transaction.Transaction(), false, false)
|
|
||||||
if err != nil {
|
|
||||||
ruleError := TxRuleError{}
|
|
||||||
if errors.As(err, &ruleError) {
|
|
||||||
if ruleError.RejectCode == RejectDuplicate {
|
|
||||||
return true, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
log.Debugf("Validation for high priority transaction %s failed: %s", transaction.TransactionID(), err)
|
|
||||||
return false, nil
|
|
||||||
}
|
|
||||||
return false, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -600,10 +600,6 @@ func TestRevalidateHighPriorityTransactionsWithChain(t *testing.T) {
|
|||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
for i, transaction := range chain {
|
|
||||||
t.Logf("chain %d %s", i, consensushashing.TransactionID(transaction))
|
|
||||||
}
|
|
||||||
|
|
||||||
_, err = miningManager.ValidateAndInsertTransaction(chain[0], true, false)
|
_, err = miningManager.ValidateAndInsertTransaction(chain[0], true, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user