1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
crate::ix!();

pub trait Initialize {
    fn initialize(&mut self, pcontext: *mut c_void) -> bool;
}

pub trait Shutdown {
    fn shutdown(&mut self);
}

pub trait NotifyBlock {

    /**
      | Notifies of ConnectTip result, i.e.,
      | new active tip only
      |
      */
    fn notify_block(&mut self, pindex: *const BlockIndex) -> bool;
}

pub trait NotifyBlockConnect {

    /**
      | Notifies of every block connection
      |
      */
    fn notify_block_connect(&mut self, pindex: *const BlockIndex) -> bool;
}

pub trait NotifyBlockDisconnect {

    /**
      | Notifies of every block disconnection
      |
      */
    fn notify_block_disconnect(&mut self, pindex: *const BlockIndex) -> bool;
}

pub trait NotifyTransactionAcceptance {

    /**
      | Notifies of every mempool acceptance
      |
      */
    fn notify_transaction_acceptance(&mut self, 
            transaction:      &Transaction,
            mempool_sequence: u64) -> bool;
}

pub trait NotifyTransactionRemoval {

    /**
      | Notifies of every mempool removal,
      | except inclusion in blocks
      |
      */
    fn notify_transaction_removal(&mut self, 
            transaction:      &Transaction,
            mempool_sequence: u64) -> bool;
}

pub trait NotifyTransaction {

    /**
      | Notifies of transactions added to mempool
      | or appearing in blocks
      |
      */
    fn notify_transaction(&mut self, transaction: &Transaction) -> bool;
}