mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-11-24 14:35:53 +00:00
Ignore RejectDuplicate and swallow other rule errors
This commit is contained in:
parent
348e4daffe
commit
b226d8e9bc
@ -4,6 +4,7 @@ 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) {
|
||||||
@ -109,6 +110,15 @@ func (mp *mempool) revalidateTransaction(transaction *model.MempoolTransaction)
|
|||||||
|
|
||||||
_, err = mp.validateAndInsertTransaction(transaction.Transaction(), false, false)
|
_, err = mp.validateAndInsertTransaction(transaction.Transaction(), false, false)
|
||||||
if err != nil {
|
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 false, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user