CRYPTO NEWS

Crypto prices continue to tank, lawsuit takes aim at Binance.US, and Celsius moves $320M worth of digital assets: Hodler’s Digest, June 12-18

The only factor to distinguish coin base transactions

In bitcoin source code here is a function to check if the given transaction is coin base or not. Here is the function: bool IsCoinBase() const { return (vin.size() == 1 && vin[0].prevout.IsNull()); } My question is that does it really need to check if vin.size() is equal to 1? Isn’t vin[0].prevoud.IsNull() sufficient condition for::Listen

In bitcoin source code here is a function to check if the given transaction is coin base or not. Here is the function:

    bool IsCoinBase() const     {         return (vin.size() == 1 && vin[0].prevout.IsNull());     } 

My question is that does it really need to check if vin.size() is equal to 1? Isn’t vin[0].prevoud.IsNull() sufficient condition for a transaction to be coin base? Is there any situation that the later condition is true but we have more than one input?

The only reason I can guess is to avoid run-time error when vin is empty (So there is no vin[0]).

Crypto Hats, Crypto Shirts, Crypto Socks, Crypto Clothing

Crypto prices continue to tank, lawsuit takes aim at Binance.US, and Celsius moves $320M worth of digital assets: Hodler’s Digest, June 12-18

Shopping cart
There are no products in the cart!
Continue shopping
0