| 57 | } |
| 58 | |
| 59 | static void wait_plugin(struct bitcoind *bitcoind, const char *method, |
| 60 | struct plugin *p) |
| 61 | { |
| 62 | /* We need our Bitcoin backend to be initialized, but the plugins have |
| 63 | * not yet been started at this point. |
| 64 | * So send `init` to each plugin which registered for a Bitcoin method |
| 65 | * and wait for its response, which we take as an ACK that it is |
| 66 | * operational (i.e. bcli will wait for `bitcoind` to be warmed up |
| 67 | * before responding to `init`). |
| 68 | * Note that lightningd/plugin will not send `init` to an already |
| 69 | * configured plugin. */ |
| 70 | if (p->plugin_state == NEEDS_INIT) |
| 71 | config_plugin(p); |
| 72 | |
| 73 | strmap_add(&bitcoind->pluginsmap, method, p); |
| 74 | } |
| 75 | |
| 76 | void bitcoind_check_commands(struct bitcoind *bitcoind) |
| 77 | { |
no test coverage detected