setLastSeenBlockHash(other.getLastSeenBlockHash());
setLastSeenBlockHash(other.getLastSeenBlockHash());
setLastSeenBlockHash(other.getLastSeenBlockHash());
setLastSeenBlockHash(other.getLastSeenBlockHash());
setLastSeenBlockHash(other.getLastSeenBlockHash());
wallet.setLastBlockSeenHash(null); } else { wallet.setLastBlockSeenHash(byteStringToHash(walletProto.getLastSeenBlockHash()));
wallet.setLastBlockSeenHash(null); } else { wallet.setLastBlockSeenHash(byteStringToHash(walletProto.getLastSeenBlockHash()));
wallet.setLastBlockSeenHash(null); } else { wallet.setLastBlockSeenHash(byteStringToHash(walletProto.getLastSeenBlockHash()));
wallet.setLastBlockSeenHash(null); } else { wallet.setLastBlockSeenHash(byteStringToHash(walletProto.getLastSeenBlockHash()));
wallet.setLastBlockSeenHash(null); } else { wallet.setLastBlockSeenHash(byteStringToHash(walletProto.getLastSeenBlockHash()));
@Test public void testLastBlockSeenHash() throws Exception { // Test the lastBlockSeenHash field works. // LastBlockSeenHash should be empty if never set. Wallet wallet = new Wallet(PARAMS); Protos.Wallet walletProto = new WalletProtobufSerializer().walletToProto(wallet); ByteString lastSeenBlockHash = walletProto.getLastSeenBlockHash(); assertTrue(lastSeenBlockHash.isEmpty()); // Create a block. Block block = PARAMS.getDefaultSerializer().makeBlock(BlockTest.blockBytes); Sha256Hash blockHash = block.getHash(); wallet.setLastBlockSeenHash(blockHash); wallet.setLastBlockSeenHeight(1); // Roundtrip the wallet and check it has stored the blockHash. Wallet wallet1 = roundTrip(wallet); assertEquals(blockHash, wallet1.getLastBlockSeenHash()); assertEquals(1, wallet1.getLastBlockSeenHeight()); // Test the Satoshi genesis block (hash of all zeroes) is roundtripped ok. Block genesisBlock = MainNetParams.get().getGenesisBlock(); wallet.setLastBlockSeenHash(genesisBlock.getHash()); Wallet wallet2 = roundTrip(wallet); assertEquals(genesisBlock.getHash(), wallet2.getLastBlockSeenHash()); }
/** * <code>optional bytes last_seen_block_hash = 2;</code> * * <pre> * The SHA256 hash of the head of the best chain seen by this wallet. * </pre> */ public Builder clearLastSeenBlockHash() { bitField0_ = (bitField0_ & ~0x00000002); lastSeenBlockHash_ = getDefaultInstance().getLastSeenBlockHash(); onChanged(); return this; }
/** * <code>optional bytes last_seen_block_hash = 2;</code> * * <pre> * The SHA256 hash of the head of the best chain seen by this wallet. * </pre> */ public Builder clearLastSeenBlockHash() { bitField0_ = (bitField0_ & ~0x00000002); lastSeenBlockHash_ = getDefaultInstance().getLastSeenBlockHash(); onChanged(); return this; }
/** * <code>optional bytes last_seen_block_hash = 2;</code> * * <pre> * The SHA256 hash of the head of the best chain seen by this wallet. * </pre> */ public Builder clearLastSeenBlockHash() { bitField0_ = (bitField0_ & ~0x00000002); lastSeenBlockHash_ = getDefaultInstance().getLastSeenBlockHash(); onChanged(); return this; }
/** * <code>optional bytes last_seen_block_hash = 2;</code> * * <pre> * The SHA256 hash of the head of the best chain seen by this wallet. * </pre> */ public Builder clearLastSeenBlockHash() { bitField0_ = (bitField0_ & ~0x00000002); lastSeenBlockHash_ = getDefaultInstance().getLastSeenBlockHash(); onChanged(); return this; }
/** * <code>optional bytes last_seen_block_hash = 2;</code> * * <pre> * The SHA256 hash of the head of the best chain seen by this wallet. * </pre> */ public Builder clearLastSeenBlockHash() { bitField0_ = (bitField0_ & ~0x00000002); lastSeenBlockHash_ = getDefaultInstance().getLastSeenBlockHash(); onChanged(); return this; }