MCPcopy Create free account
hub / github.com/ElementsProject/lightning / sendrawtransaction

Function sendrawtransaction

plugins/bcli.c:756–791  ·  view source on GitHub ↗

Send a transaction to the Bitcoin network. * Calls `sendrawtransaction` using the first parameter as the raw tx. */

Source from the content-addressed store, hash-verified

754 * Calls `sendrawtransaction` using the first parameter as the raw tx.
755 */
756static struct command_result *sendrawtransaction(struct command *cmd,
757 const char *buf,
758 const jsmntok_t *toks)
759{
760 const char *tx, *highfeesarg;
761 bool *allowhighfees;
762
763 /* bitcoin-cli wants strings. */
764 if (!param(cmd, buf, toks,
765 p_req("tx", param_string, &tx),
766 p_req("allowhighfees", param_bool, &allowhighfees),
767 NULL))
768 return command_param_failed();
769
770 if (*allowhighfees) {
771 if (bitcoind->version >= 190001)
772 /* Starting in 19.0.1, second argument is
773 * maxfeerate, which when set to 0 means
774 * no max feerate.
775 */
776 highfeesarg = "0";
777 else
778 /* in older versions, second arg is allowhighfees,
779 * set to true to allow high fees.
780 */
781 highfeesarg = "true";
782 } else
783 highfeesarg = NULL;
784
785 start_bitcoin_cli(NULL, cmd, process_sendrawtransaction, true,
786 BITCOIND_HIGH_PRIO, NULL,
787 "sendrawtransaction",
788 tx, highfeesarg, NULL);
789
790 return command_still_pending(cmd);
791}
792
793static struct command_result *getutxout(struct command *cmd,
794 const char *buf,

Callers

nothing calls this directly

Calls 4

start_bitcoin_cliFunction · 0.85
command_param_failedFunction · 0.70
command_still_pendingFunction · 0.70
paramFunction · 0.50

Tested by

no test coverage detected