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