mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-23 09:04:22 +01:00
Add plugin notification topic "block_processed".
Changelog-Added: Plugins: Added notification topic "block_processed".
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
#include <lightningd/jsonrpc.h>
|
||||
#include <lightningd/lightningd.h>
|
||||
#include <lightningd/log.h>
|
||||
#include <lightningd/notification.h>
|
||||
#include <math.h>
|
||||
#include <wallet/txfilter.h>
|
||||
|
||||
@@ -818,9 +819,13 @@ static void get_new_block(struct bitcoind *bitcoind,
|
||||
/* Unexpected predecessor? Free predecessor, refetch it. */
|
||||
if (!bitcoin_blkid_eq(&topo->tip->blkid, &blk->hdr.prev_hash))
|
||||
remove_tip(topo);
|
||||
else
|
||||
else {
|
||||
add_tip(topo, new_block(topo, blk, topo->tip->height + 1));
|
||||
|
||||
/* tell plugins a new block was processed */
|
||||
notify_block_processed(topo->ld, topo->tip);
|
||||
}
|
||||
|
||||
/* Try for next one. */
|
||||
try_extend_tip(topo);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user