File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -538,4 +538,21 @@ bool kernel_witness_is_null(const kernel_TransactionWitness* _witness)
538
538
return witness->IsNull ();
539
539
}
540
540
541
+ uint32_t kernel_transaction_get_output_count (const kernel_Transaction* _transaction)
542
+ {
543
+ const auto * transaction = cast_const_transaction (_transaction);
544
+
545
+ return transaction->vout .size ();
546
+ }
547
+
548
+ const kernel_TransactionOutput* kernel_transaction_get_output (const kernel_Transaction* _transaction, size_t index)
549
+ {
550
+ const auto * transaction = cast_const_transaction (_transaction);
551
+
552
+ if (index >= transaction->vout .size ()) {
553
+ return nullptr ;
554
+ }
555
+
556
+ return reinterpret_cast <const kernel_TransactionOutput*>(&transaction->vout [index]);
557
+ }
541
558
} // extern "C"
Original file line number Diff line number Diff line change @@ -137,6 +137,10 @@ BITCOINKERNEL_API kernel_ByteArray* BITCOINKERNEL_WARN_UNUSED_RESULT kernel_witn
137
137
138
138
BITCOINKERNEL_API bool BITCOINKERNEL_WARN_UNUSED_RESULT kernel_witness_is_null (const kernel_TransactionWitness* witness) BITCOINKERNEL_ARG_NONNULL(1 );
139
139
140
+ BITCOINKERNEL_API uint32_t BITCOINKERNEL_WARN_UNUSED_RESULT kernel_transaction_get_output_count (const kernel_Transaction* transaction) BITCOINKERNEL_ARG_NONNULL(1 );
141
+
142
+ BITCOINKERNEL_API const kernel_TransactionOutput* BITCOINKERNEL_WARN_UNUSED_RESULT kernel_transaction_get_output (const kernel_Transaction* transaction, size_t index) BITCOINKERNEL_ARG_NONNULL(1 );
143
+
140
144
#ifdef __cplusplus
141
145
}
142
146
#endif
You can’t perform that action at this time.
0 commit comments