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);
}