Skip to content

Commit ca02b68

Browse files
committed
doc: document coin selection tracepoints
1 parent 8e3f39e commit ca02b68

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

doc/tracing.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,49 @@ Arguments passed:
168168
4. Value of the coin as `int64`
169169
5. If the coin is a coinbase as `bool`
170170

171+
### Context `coin_selection`
172+
173+
#### Tracepoint `coin_selection:selected_coins`
174+
175+
Is called when `SelectCoins` completes.
176+
177+
Arguments passed:
178+
1. Wallet name as `pointer to C-style string`
179+
2. Coin selection algorithm name as `pointer to C-style string`
180+
3. Selection target value as `int64`
181+
4. Calculated waste metric of the solution as `int64`
182+
5. Total value of the selected inputs as `int64`
183+
184+
#### Tracepoint `coin_selection:normal_create_tx_internal`
185+
186+
Is called when the first `CreateTransactionInternal` completes.
187+
188+
Arguments passed:
189+
1. Wallet name as `pointer to C-style string`
190+
2. Whether `CreateTransactionInternal` succeeded as `bool`
191+
3. The expected transaction fee as an `int64`
192+
4. The position of the change output as an `int32`
193+
194+
#### Tracepoint `coin_selection:attempting_aps_create_tx`
195+
196+
Is called when `CreateTransactionInternal` is called the second time for the optimistic
197+
Avoid Partial Spends selection attempt. This is used to determine whether the next
198+
tracepoints called are for the Avoid Partial Spends solution, or a different transaction.
199+
200+
Arguments passed:
201+
1. Wallet name as `pointer to C-style string`
202+
203+
#### Tracepoint `coin_selection:aps_create_tx_internal`
204+
205+
Is called when the second `CreateTransactionInternal` with Avoid Partial Spends enabled completes.
206+
207+
Arguments passed:
208+
1. Wallet name as `pointer to C-style string`
209+
2. Whether the Avoid Partial Spends solution will be used as `bool`
210+
3. Whether `CreateTransactionInternal` succeeded as` bool`
211+
4. The expected transaction fee as an `int64`
212+
5. The position of the change output as an `int32`
213+
171214
## Adding tracepoints to Bitcoin Core
172215

173216
To add a new tracepoint, `#include <util/trace.h>` in the compilation unit where

0 commit comments

Comments
 (0)