fix(wallet) don't delete pending transactions for multi-transaction
This is done in Nim after the watched pending transaction changes state. Note: tried to delete all transactions, not only multi-transaction, as soon as the state is downloaded but it didn't work: noticed crashes with minted transactions after restart. Updates status-desktop #10474
This commit is contained in:
parent
8a95dab5eb
commit
c5a8b40d9c
|
@ -362,26 +362,15 @@ func (c *transfersCommand) Run(ctx context.Context) (err error) {
|
|||
// Update MultiTransactionID from pending entry
|
||||
for index := range allTransfers {
|
||||
transfer := &allTransfers[index]
|
||||
if transfer.MultiTransactionID == NoMultiTransactionID {
|
||||
entry, err := c.transactionManager.GetPendingEntry(c.chainClient.ChainID, transfer.ID)
|
||||
if err != nil {
|
||||
if err == sql.ErrNoRows {
|
||||
log.Info("Pending transaction not found for", "chainID", c.chainClient.ChainID, "transferID", transfer.ID)
|
||||
} else {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
if err == nil {
|
||||
// Propagate the MultiTransactionID, in case the pending entry was a multi-transaction
|
||||
transfer.MultiTransactionID = entry.MultiTransactionID
|
||||
if transfer.Receipt != nil && transfer.Receipt.Status == types.ReceiptStatusSuccessful {
|
||||
// TODO: Nim logic was deleting pending previously, should we notify UI about it?
|
||||
err := c.transactionManager.DeletePending(c.chainClient.ChainID, transfer.ID)
|
||||
if err != nil {
|
||||
} else if err != sql.ErrNoRows {
|
||||
log.Error("GetPendingEntry error", "error", err)
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if len(allTransfers) > 0 {
|
||||
err = c.db.SaveTransfersMarkBlocksLoaded(c.chainClient.ChainID, c.address, allTransfers, []*big.Int{c.block})
|
||||
|
|
Loading…
Reference in New Issue