bitmessage.network.Payload.SaveAsync C# (CSharp) Method

SaveAsync() public method

public SaveAsync ( Bitmessage bm ) : void
bm Bitmessage
return void
        public void SaveAsync(Bitmessage bm)
        {
            if (SentData == null)
                throw new Exception("Payload.SaveAsync SentData == null");
            if (String.IsNullOrEmpty(Command) || (Command.Length > 30))
                throw new Exception("Payload.SaveAsync Command incorrect =" + Command);
            if (InventoryVector == null)
                throw new Exception("Payload.SaveAsync InventoryVector==null");
            if (InventoryVector.Length != 32)
                throw new Exception("Payload.SaveAsync InventoryVector.Length != 32");

            if(bm.MemoryInventory.Insert(InventoryVector))
                bm.DB.InsertOrReplaceAsync(this);

            bm.OnNewPayload(this);
        }

Usage Example

Example #1
0
        internal void Send()
        {
            Payload p = GetPayload();

            p.SaveAsync(_bm);
        }