File tree Expand file tree Collapse file tree 1 file changed +24
-2
lines changed
Expand file tree Collapse file tree 1 file changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -606,10 +606,32 @@ impl Daemon {
606606 blockhash : & BlockHash ,
607607 verbose : bool ,
608608 ) -> Result < Value > {
609- self . request (
609+ match self . request (
610610 "getrawtransaction" ,
611611 json ! ( [ txid. to_hex( ) , verbose, blockhash] ) ,
612- )
612+ ) {
613+ #[ cfg( not( feature = "liquid" ) ) ]
614+ Err ( e)
615+ if e. to_string ( ) . contains (
616+ "genesis block coinbase is not considered an ordinary transaction" ,
617+ ) =>
618+ {
619+ let block = self . getblock ( blockhash) ?;
620+
621+ // Assert that there's only 1 tx, the previous block hash is all zeroes, and not using verbose
622+ if verbose
623+ || block. txdata . len ( ) != 1
624+ || block. header . prev_blockhash != BlockHash :: default ( )
625+ {
626+ Err ( e)
627+ } else {
628+ Ok ( Value :: String ( bitcoin:: consensus:: encode:: serialize_hex (
629+ & block. txdata [ 0 ] ,
630+ ) ) )
631+ }
632+ }
633+ res => res,
634+ }
613635 }
614636
615637 pub fn getmempooltx ( & self , txhash : & Txid ) -> Result < Transaction > {
You can’t perform that action at this time.
0 commit comments