src/Stratis.FederatedPeg.Features.FederationGateway/TargetChain/CrossChainTransferStore.cs
/// <summary>Starts the cross-chain-transfer store.</summary>
Starts the cross-chain-transfer store.
Starts the cross - chain - transfer store .
public void Start()
        {
            lock (this.lockObj)
            {
                if (this.federationWalletManager.RemoveTransientTransactions())
                    this.federationWalletManager.SaveWallet();
                Guard.Assert(this.Synchronize());
                FederationWallet wallet = this.federationWalletManager.GetWallet();
                ICrossChainTransfer[] transfers = this.GetTransfersByStatus(new[] { CrossChainTransferStatus.SeenInBlock }, true, false).ToArray();
                foreach (ICrossChainTransfer transfer in transfers)
                {
                    (Transaction tran, TransactionData tranData, _) = this.federationWalletManager.FindWithdrawalTransactions(transfer.DepositTransactionId).FirstOrDefault();
                    if (tran == null && wallet.LastBlockSyncedHeight >= transfer.BlockHeight)
                    {
                        this.federationWalletManager.ProcessTransaction(transfer.PartialTransaction);
                        (tran, tranData, _) = this.federationWalletManager.FindWithdrawalTransactions(transfer.DepositTransactionId).FirstOrDefault();
                        tranData.BlockHeight = transfer.BlockHeight;
                        tranData.BlockHash = transfer.BlockHash;
                    }
                }
            }
        }
public void Start ( ) { lock ( this . lockObj ) { if ( this . federationWalletManager . RemoveTransientTransactions ( ) ) this . federationWalletManager . SaveWallet ( ) ; Guard . Assert ( this . Synchronize ( ) ) ; FederationWallet wallet = this . federationWalletManager . GetWallet ( ) ; ICrossChainTransfer [ ] transfers = this . GetTransfersByStatus ( new [ ] { CrossChainTransferStatus . SeenInBlock } , true , false ) . ToArray ( ) ; foreach ( ICrossChainTransfer transfer in transfers ) { ( Transaction tran , TransactionData tranData , _ ) = this . federationWalletManager . FindWithdrawalTransactions ( transfer . DepositTransactionId ) . FirstOrDefault ( ) ; if ( tran == null && wallet . LastBlockSyncedHeight >= transfer . BlockHeight ) { this . federationWalletManager . ProcessTransaction ( transfer . PartialTransaction ) ; ( tran , tranData , _ ) = this . federationWalletManager . FindWithdrawalTransactions ( transfer . DepositTransactionId ) . FirstOrDefault ( ) ; tranData . BlockHeight = transfer . BlockHeight ; tranData . BlockHash = transfer . BlockHash ; } } } }
Starts the cross-chain-transfer store.
Starts the cross - chain - transfer store .
// Remove all transient transactions from the wallet to be re-added according to the // information carried in the store. This ensures that we will re-sync in the case // where the store may have been deleted. // Any partial transfers affected by these removals are expected to first become // suspended due to the missing wallet transactions which will rewind the counter- // chain tip to then reprocess them. // Any transactions seen in blocks must also be present in the wallet.