]> Untitled Git - bdk/commitdiff
Change `populate_test_db` to not return empty input
authorwszdexdrf <piyushkumar2k02@kgpian.iitkgp.ac.in>
Thu, 25 Aug 2022 17:29:59 +0000 (22:59 +0530)
committerwszdexdrf <piyushkumar2k02@kgpian.iitkgp.ac.in>
Mon, 29 Aug 2022 08:24:01 +0000 (13:54 +0530)
src/database/memory.rs

index 7d806eb4af24455b43810912998d1595c39d2a02..ad1eda96ba111be7911ee73af62070d2de9df1b6 100644 (file)
@@ -490,11 +490,10 @@ macro_rules! populate_test_db {
         let mut db = $db;
         let tx_meta = $tx_meta;
         let current_height: Option<u32> = $current_height;
-        let input = if $is_coinbase {
-            vec![$crate::bitcoin::TxIn::default()]
-        } else {
-            vec![]
-        };
+        let mut input = vec![$crate::bitcoin::TxIn::default()];
+        if !$is_coinbase {
+            input[0].previous_output.vout = 0;
+        }
         let tx = $crate::bitcoin::Transaction {
             version: 1,
             lock_time: 0,