X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=c_sharp%2Fsrc%2Forg%2Fldk%2Fstructs%2FBroadcasterInterface.cs;fp=c_sharp%2Fsrc%2Forg%2Fldk%2Fstructs%2FBroadcasterInterface.cs;h=5d791dd67fa51c3984a592d8d211b03f05ba4648;hb=c6777737ea14e7814b0fa7d6fe16536f31d4a82b;hp=9e0dd04fbd621b041b9f628d7b2d56c7d068f7fb;hpb=ee72c84d4bf9e2404e02fe20155efb502ceaee1b;p=ldk-java diff --git a/c_sharp/src/org/ldk/structs/BroadcasterInterface.cs b/c_sharp/src/org/ldk/structs/BroadcasterInterface.cs index 9e0dd04f..5d791dd6 100644 --- a/c_sharp/src/org/ldk/structs/BroadcasterInterface.cs +++ b/c_sharp/src/org/ldk/structs/BroadcasterInterface.cs @@ -21,17 +21,29 @@ public class BroadcasterInterface : CommonBase { public interface BroadcasterInterfaceInterface { /** - * Sends a transaction out to (hopefully) be mined. + * Sends a list of transactions out to (hopefully) be mined. + * This only needs to handle the actual broadcasting of transactions, LDK will automatically + * rebroadcast transactions that haven't made it into a block. + * + * In some cases LDK may attempt to broadcast a transaction which double-spends another + * and this isn't a bug and can be safely ignored. + * + * If more than one transaction is given, these transactions should be considered to be a + * package and broadcast together. Some of the transactions may or may not depend on each other, + * be sure to manage both cases correctly. + * + * Bitcoin transaction packages are defined in BIP 331 and here: + * https://github.com/bitcoin/bitcoin/blob/master/doc/policy/packages.md */ - void broadcast_transaction(byte[] _tx); + void broadcast_transactions(byte[][] _txs); } private class LDKBroadcasterInterfaceHolder { internal BroadcasterInterface held; } private class LDKBroadcasterInterfaceImpl : bindings.LDKBroadcasterInterface { internal LDKBroadcasterInterfaceImpl(BroadcasterInterfaceInterface arg, LDKBroadcasterInterfaceHolder impl_holder) { this.arg = arg; this.impl_holder = impl_holder; } private BroadcasterInterfaceInterface arg; private LDKBroadcasterInterfaceHolder impl_holder; - public void broadcast_transaction(byte[] _tx) { - arg.broadcast_transaction(_tx); + public void broadcast_transactions(byte[][] _txs) { + arg.broadcast_transactions(_txs); GC.KeepAlive(arg); } } @@ -41,12 +53,24 @@ public class BroadcasterInterface : CommonBase { return impl_holder.held; } /** - * Sends a transaction out to (hopefully) be mined. + * Sends a list of transactions out to (hopefully) be mined. + * This only needs to handle the actual broadcasting of transactions, LDK will automatically + * rebroadcast transactions that haven't made it into a block. + * + * In some cases LDK may attempt to broadcast a transaction which double-spends another + * and this isn't a bug and can be safely ignored. + * + * If more than one transaction is given, these transactions should be considered to be a + * package and broadcast together. Some of the transactions may or may not depend on each other, + * be sure to manage both cases correctly. + * + * Bitcoin transaction packages are defined in BIP 331 and here: + * https://github.com/bitcoin/bitcoin/blob/master/doc/policy/packages.md */ - public void broadcast_transaction(byte[] tx) { - bindings.BroadcasterInterface_broadcast_transaction(this.ptr, tx); + public void broadcast_transactions(byte[][] txs) { + bindings.BroadcasterInterface_broadcast_transactions(this.ptr, txs); GC.KeepAlive(this); - GC.KeepAlive(tx); + GC.KeepAlive(txs); } }