BitSharper.Wallet.SendCoins C# (CSharp) Méthode

SendCoins() public méthode

Sends coins to the given address, via the given PeerGroup. Change is returned to the first key in the wallet.
If there was a problem broadcasting the transaction.
public SendCoins ( PeerGroup peerGroup, Address to, ulong nanocoins ) : Transaction
peerGroup PeerGroup The peer group to send via.
to Address Which address to send coins to.
nanocoins ulong How many nanocoins to send. You can use Utils.toNanoCoins() to calculate this.
Résultat Transaction
        public Transaction SendCoins(PeerGroup peerGroup, Address to, ulong nanocoins)
        {
            lock (this)
            {
                var tx = CreateSend(to, nanocoins);
                if (tx == null) // Not enough money! :-(
                    return null;
                if (!peerGroup.BroadcastTransaction(tx))
                {
                    throw new IOException("Failed to broadcast tx to all connected peers");
                }

                // TODO - retry logic
                ConfirmSend(tx);
                return tx;
            }
        }

Same methods

Wallet::SendCoins ( Peer peer, Address to, ulong nanocoins ) : Transaction