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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
crate::ix!();

/**
  | Interface giving clients (wallet processes,
  | maybe other analysis tools in the future)
  | ability to access to the chain state, receive
  | notifications, estimate fees, and submit
  | transactions.
  |
  | TODO: Current chain methods are too low level,
  | exposing too much of the internal workings of
  | the bitcoin node, and not being very
  | convenient to use.  Chain methods should be
  | cleaned up and simplified over time. Examples:
  |
  | * The initMessages() and showProgress()
  |   methods which the wallet uses to send
  |   notifications to the GUI should go away when
  |   GUI and wallet can directly communicate with
  |   each other without going through the node
  |   (https://github.com/bitcoin/bitcoin/pull/15288#discussion_r253321096).
  |
  | * The handleRpc, registerRpcs,
  |   rpcEnableDeprecated methods and other RPC
  |   methods can go away if wallets listen for
  |   HTTP requests on their own ports instead of
  |   registering to handle requests on the node
  |   HTTP port.
  |
  | * Move fee estimation queries to an
  |   asynchronous interface and let the wallet
  |   cache it, fee estimation being driven by
  |   node mempool, wallet should be the consumer.
  |
  | * `guessVerificationProgress` and similar
  |   methods can go away if rescan logic moves
  |   out of the wallet, and the wallet just
  |   requests scans from the node
  |   (https://github.com/bitcoin/bitcoin/issues/11756)
  */
pub trait ChainInterface:
ChainHeight
+ GetBlockHash
+ HaveBlockOnDisk
+ Tip
+ Contains<Arc<BlockIndex>>
+ GetLocator<Arc<BlockIndex>, LocatorType = BlockLocator>
+ GetTipLocator
+ FindLocatorFork
+ CheckFinalTx
+ FindBlock
+ FindFirstBlockWithTimeAndHeight
+ FindAncestorByHeight
+ FindAncestorByHash
+ FindCommonAncestor
+ FindCoins
+ GuessVerificationProgress
+ HasBlocks
+ IsRBFOptIn
+ IsInMempool
+ HasDescendantsInMempool
+ BroadcastTransaction
+ GetTransactionAncestry
+ GetPackageLimits
+ CheckChainLimits
+ EstimateSmartFee
+ EstimateMaxBlocks
+ MemPoolMinFee
+ RelayMinFee
+ RelayIncrementalFee
+ RelayDustFee
+ HavePruned
+ IsReadyToBroadcast
+ IsInitialBlockDownload
+ ShutdownRequested
+ GetAdjustedTime
+ InitMessage
+ InitWarning
+ InitError
+ ShowProgress
+ HandleNotifications
+ WaitForNotificationsIfTipChanged
+ HandleRpc
+ RpcEnableDeprecated
+ RpcRunLater
+ RpcSerializationFlags
+ GetSetting
+ GetSettingsList
+ GetRwSetting
+ UpdateRwSetting
+ RequestMempoolTransactions
+ IsTaprootActive
+ ChainNext
+ Index<i32, Output = Option<Arc<BlockIndex>>>
{}